Skip to content

Quick & Dirty email sender service using sendgrid.com and github.com/sendgrid/sendgrid-php, see exemple :

License

Notifications You must be signed in to change notification settings

PiNinja/sendgrid-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 

Repository files navigation

sendgrid-mailer

Quick & Dirty email sender via sendgrid, you can find one running here : https://sendgrid.14159.ninja/

#Logs This server does not log anything, your API Key and template id are safe on https://sendgrid.14159.ninja/, you are responsible for how you use your account. HTTPS is provided as a network listening protection but you should run your own instance of the software if you want to be 100% safe.

#Requirement You need a sendgrid.com account (free plan : 12k email per month), and an API Key generated from this account. You also need to create a transactionnal template and copy paste the ID.

Basic Recipients JSON format

Recipients should be specified as an array of object (use the following syntax):

[
{"email":"[email protected]"},
{"email":"[email protected]"},
{"email":"[email protected]"},
{"email":"[email protected]"}
]

Advanced Recipients JSON format

You can add as many substitutions code as you want in each "recipient object". Each "key" will try to replace "-key-" in your sendgrid email template:

[
{"email":"[email protected]","name":"Arthur Juchereau"},
{"email":"[email protected]","role":"Ninja"},
{"email":"[email protected]","where":"PiNinja"},
{"email":"[email protected]","name":"Arthur Juchereau","role":"Ninja","where":"PiNinja"}
]

With the template

Hello -name-, you are -role- in -where-

Will send an email to :

[email protected] => "Hello Arthur Juchereau, you are -role- at -where-"
[email protected] => "Hello -name, you are Ninja at -where-"
[email protected] => "Hello -name-, you are -role- at PiNinja"
[email protected] => "Hello Arthur Juchereau, you are Ninja at PiNinja"

Customize your script

If you plan on using this script extensively, it is recommended to fork the repository and custom fit to your needs (for intance, sending at a specific date, attach files, use sections in sendgrid,etc). We can help as well.

How to contribute

Feel free to submit pull request in order to support more features from sendgrid.

About

Quick & Dirty email sender service using sendgrid.com and github.com/sendgrid/sendgrid-php, see exemple :

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published