Skip to content

Commit 61137e5

Browse files
committed
Initial commit
0 parents  commit 61137e5

17 files changed

+1300
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.yml]
14+
indent_size = 2
15+
16+
[*.json]
17+
charset = utf-8
18+
indent_size = 2

.gitattributes

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Define the line ending behavior of the different file extensions
2+
# Set default behaviour, in case users don't have core.autocrlf set.
3+
* text=auto
4+
* text eol=lf
5+
6+
# Explicitly declare text files we want to always be normalized and converted
7+
# to native line endings on checkout.
8+
*.php text
9+
*.default text
10+
*.ctp text
11+
*.sql text
12+
*.md text
13+
*.po text
14+
*.js text
15+
*.css text
16+
*.ini text
17+
*.properties text
18+
*.txt text
19+
*.xml text
20+
*.svg text
21+
*.yml text
22+
.htaccess text
23+
24+
# Declare files that will always have CRLF line endings on checkout.
25+
*.bat eol=crlf
26+
27+
# Declare files that will always have LF line endings on checkout.
28+
*.pem eol=lf
29+
30+
# Denote all files that are truly binary and should not be modified.
31+
*.png binary
32+
*.jpg binary
33+
*.gif binary
34+
*.ico binary
35+
*.mo binary
36+
*.pdf binary
37+
*.phar binary
38+
*.woff binary
39+
*.woff2 binary
40+
*.ttf binary
41+
*.otf binary
42+
*.eot binary

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/config/app.php
2+
3+
/.htpasswd
4+
/vendor/*
5+
.DS_Store
6+
.DS_Store?
7+
._*
8+
.Spotlight-V100
9+
.Trashes
10+
Icon?
11+
ehthumbs.db
12+
ehthumbs_vista.db
13+
Thumbs.db
14+
Desktop.ini
15+
$RECYCLE.BIN/
16+
*.stackdump
17+
/.well-known/*
18+
*~
19+
*.swp
20+
*.swo
21+
*.sublime-*
22+
*.stTheme.cache
23+
*.tmlanguage.cache
24+
*.tmPreferences.cache
25+
.settings/*
26+
.idea/*
27+
nbproject/*
28+
.vscode
29+
.sass-cache/
30+
*.php_cs.cache
31+
/.scannerwork/*
32+
/.settings/*
33+
/.tests/*

.htaccess

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<IfModule mod_headers.c>
2+
RequestHeader unset Proxy
3+
</IfModule>
4+
<IfModule mod_rewrite.c>
5+
RewriteEngine on
6+
RewriteBase /
7+
8+
RewriteCond %{REQUEST_URI} !^/webroot/
9+
RewriteCond %{REQUEST_URI} !^(\.well-known/.*)$
10+
RewriteRule ^(.*)$ /webroot/$1 [QSA,L]
11+
12+
RewriteRule ^(\.well-known/.*)$ $1 [L]
13+
14+
RewriteCond %{HTTP:Authorization} ^(.*)
15+
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
16+
</IfModule>
17+
18+
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
19+
20+
<IfModule mod_headers.c>
21+
Header set Access-Control-Allow-Origin: "*"
22+
Header set Access-Control-Allow-Methods: "POST"
23+
Header set Access-Control-Allow-Headers: "Authorization, Access-Control-Allow-Origin, Content-Type"
24+
</IfModule>

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Pittica S.r.l.s.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Post SendGrid
2+
3+
[![LICENSE](https://img.shields.io/github/license/pittica/post-sendgrid.svg)](LICENSE)
4+
[![packagist](https://img.shields.io/badge/packagist-pittica%2Fpost--sendgrid-brightgreen.svg)](https://packagist.org/packages/pittica/post-sendgrid)
5+
![PHP from Packagist](https://img.shields.io/packagist/php-v/pittica/post-sendgrid)
6+
7+
This project uses SendGrid to send data from contact forms.
8+
9+
## Installation
10+
11+
You can install _post-sendgrid_ using [Composer](https://getcomposer.org).
12+
13+
``` bash
14+
composer create-project --prefer-dist pittica/post-sendgrid
15+
```
16+
17+
## Configuration
18+
19+
Create and edit a **config/app.php** file.
20+
21+
### Example
22+
23+
``` php
24+
<?php
25+
26+
return [
27+
'fields' => [
28+
'whitelisted' => [
29+
'message'
30+
],
31+
'email' => 'email',
32+
'subject' => 'subject',
33+
'name' => 'name',
34+
'labels' => [
35+
'message' => 'Message',
36+
'email' => 'E-Mail',
37+
'subject' => 'Subject'
38+
]
39+
],
40+
'sender' => [
41+
'address' => 'YOUR@EMAIL.ADDRESS',
42+
'name' => 'YOUR NAME'
43+
],
44+
'api' => [
45+
'key' => 'SendGrid API KEY'
46+
],
47+
'recaptcha' => [
48+
'key' => 'RECAPTCHA KEY',
49+
'field' => 'g-recaptcha'
50+
]
51+
];
52+
```
53+
54+
## Copyright
55+
56+
© 2020 [Pittica S.r.l.s.](https://pittica.com)

composer.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "pittica/post-sendgrid",
3+
"homepage": "https://github.com/pittica/post-sendgrid",
4+
"description": "Send e-mails using SendGrid from HTTP POST",
5+
"type": "project",
6+
"license": "MIT",
7+
"keywords": [
8+
"email",
9+
"sendgrid",
10+
"post"
11+
],
12+
"authors": [
13+
{
14+
"name": "Lucio Benini",
15+
"email": "info@pittica.com",
16+
"homepage": "https://pittica.com",
17+
"role": "Web Developer"
18+
}
19+
],
20+
"autoload": {
21+
"psr-4": {
22+
"Pittica\\PostSendGrid\\": "src"
23+
}
24+
},
25+
"minimum-stability": "stable",
26+
"require": {
27+
"ext-curl": "*",
28+
"ext-json": "*",
29+
"php": "^7.1",
30+
"sendgrid/sendgrid": "^7.0",
31+
"guzzlehttp/guzzle": "^6.5.2",
32+
"google/recaptcha": "^1.2"
33+
},
34+
"prefer-stable": true,
35+
"config": {
36+
"sort-packages": true
37+
}
38+
}

0 commit comments

Comments
 (0)