Has there ever been a time when you wanted to know if someone opened up an important email? Maybe you want to get a real-time alert when people mark your email as spam. Or perhaps get immediately notified if a user clicks on your email’s unsubscribe link.

This is possible with our Event Webhook plus an SMS API of your choosing. In this example, I will showcase a small Python program that will receive event data from SendGrid and SMS alert a user with the Twilio API.

Easy as One, Two, Three

    1. Log in to SendGrid and go to your apps page. Click on the settings link for the Event Notification app.
    2. Put in the URL of the program where your application will reside.For this example, we are creating a Python application. For testing, this can be run on your computer and opened up to the internet with ngrok. (We have a great ngrok tutorial if this is new to you).
    3. Here’s the bulk of the Python program that receives an event and sends an SMS.Feel free to customize this for your specific use case. I am using Twilio for the SMS API, you can visit their website for more info.

If you have questions or get stuck, I’m @Kunal732 on Twitter.

For more information on the Event Webhook and to see what other pieces of data SendGrid sends, check out our documentation.



SendGrid Team
Expert advice and insight about all things email including best practices tips, examples, and advice for marketers, developers, and everyone in between.