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.
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]"}
]
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"
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.
Feel free to submit pull request in order to support more features from sendgrid.