Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
luciobenini committed Feb 13, 2020
0 parents commit 61137e5
Show file tree
Hide file tree
Showing 17 changed files with 1,300 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
indent_size = 2

[*.json]
charset = utf-8
indent_size = 2
42 changes: 42 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Define the line ending behavior of the different file extensions
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
* text eol=lf

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.php text
*.default text
*.ctp text
*.sql text
*.md text
*.po text
*.js text
*.css text
*.ini text
*.properties text
*.txt text
*.xml text
*.svg text
*.yml text
.htaccess text

# Declare files that will always have CRLF line endings on checkout.
*.bat eol=crlf

# Declare files that will always have LF line endings on checkout.
*.pem eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.mo binary
*.pdf binary
*.phar binary
*.woff binary
*.woff2 binary
*.ttf binary
*.otf binary
*.eot binary
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/config/app.php

/.htpasswd
/vendor/*
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
ehthumbs_vista.db
Thumbs.db
Desktop.ini
$RECYCLE.BIN/
*.stackdump
/.well-known/*
*~
*.swp
*.swo
*.sublime-*
*.stTheme.cache
*.tmlanguage.cache
*.tmPreferences.cache
.settings/*
.idea/*
nbproject/*
.vscode
.sass-cache/
*.php_cs.cache
/.scannerwork/*
/.settings/*
/.tests/*
24 changes: 24 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<IfModule mod_headers.c>
RequestHeader unset Proxy
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/webroot/
RewriteCond %{REQUEST_URI} !^(\.well-known/.*)$
RewriteRule ^(.*)$ /webroot/$1 [QSA,L]

RewriteRule ^(\.well-known/.*)$ $1 [L]

RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
</IfModule>

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin: "*"
Header set Access-Control-Allow-Methods: "POST"
Header set Access-Control-Allow-Headers: "Authorization, Access-Control-Allow-Origin, Content-Type"
</IfModule>
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Pittica S.r.l.s.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Post SendGrid

[![LICENSE](https://img.shields.io/github/license/pittica/post-sendgrid.svg)](LICENSE)
[![packagist](https://img.shields.io/badge/packagist-pittica%2Fpost--sendgrid-brightgreen.svg)](https://packagist.org/packages/pittica/post-sendgrid)
![PHP from Packagist](https://img.shields.io/packagist/php-v/pittica/post-sendgrid)

This project uses SendGrid to send data from contact forms.

## Installation

You can install _post-sendgrid_ using [Composer](https://getcomposer.org).

``` bash
composer create-project --prefer-dist pittica/post-sendgrid
```

## Configuration

Create and edit a **config/app.php** file.

### Example

``` php
<?php

return [
'fields' => [
'whitelisted' => [
'message'
],
'email' => 'email',
'subject' => 'subject',
'name' => 'name',
'labels' => [
'message' => 'Message',
'email' => 'E-Mail',
'subject' => 'Subject'
]
],
'sender' => [
'address' => '[email protected]',
'name' => 'YOUR NAME'
],
'api' => [
'key' => 'SendGrid API KEY'
],
'recaptcha' => [
'key' => 'RECAPTCHA KEY',
'field' => 'g-recaptcha'
]
];
```

## Copyright

© 2020 [Pittica S.r.l.s.](https://pittica.com)
38 changes: 38 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "pittica/post-sendgrid",
"homepage": "https://github.com/pittica/post-sendgrid",
"description": "Send e-mails using SendGrid from HTTP POST",
"type": "project",
"license": "MIT",
"keywords": [
"email",
"sendgrid",
"post"
],
"authors": [
{
"name": "Lucio Benini",
"email": "[email protected]",
"homepage": "https://pittica.com",
"role": "Web Developer"
}
],
"autoload": {
"psr-4": {
"Pittica\\PostSendGrid\\": "src"
}
},
"minimum-stability": "stable",
"require": {
"ext-curl": "*",
"ext-json": "*",
"php": "^7.1",
"sendgrid/sendgrid": "^7.0",
"guzzlehttp/guzzle": "^6.5.2",
"google/recaptcha": "^1.2"
},
"prefer-stable": true,
"config": {
"sort-packages": true
}
}
Loading

0 comments on commit 61137e5

Please sign in to comment.