Martin Smaha
Published © GPL3+

Easy Email Notifications with Webhook and SendGrid API

Use this custom webhook template and a free SendGrid account for fast email notifications.

EasyProtip1 hour171
Easy Email Notifications with Webhook and SendGrid API

Things used in this project

Hardware components

Photon
Particle Photon
×1

Software apps and online services

SendGrid API account

Story

Read more

Code

Send Grid Template

Plain text
Copy this text into the custom webhook edit window.
{
    "event": "UniqueEventNameHere",
    "url": "https://api.sendgrid.com/v3/mail/send",
    "requestType": "POST",
    "noDefaults": true,
    "rejectUnauthorized": true,
    "headers": {
    "host": "api.sendgrid.com",
    "Content-Type": "application/json",
    "Connection": "close",
    "Authorization": "Bearer Paste_your_SendGrid_API_KEY_here"

    },
    "json": {
        "personalizations": [
            {
                "to": [
                    {
                        "email": "your_email_address",
                        "name": "your_name"
                    }
                ],
                "subject": "your_event_subject"
            }
        ],
        "from": {
            "email": "sam.smith@example.com",
            "name": "Sam Smith"
        },
        "reply_to": {
            "email": "sam.smith@example.com",
            "name": "Sam Smith"
        },
        "content": [
            {
                "type": "text/plain",
                "value": "{{PARTICLE_EVENT_VALUE}}"
            }
        ]
    }
}

Credits

Martin Smaha

Martin Smaha

4 projects • 4 followers
Designing hardware and software since 1975.
Contact

Comments

Add projectSign up / Login