SendGrid Event Notification Webhook

SendGrid sends an email, and in response, it returns X-Message-Id for example like Ctt1jcG7Qk2YJPOYWDv5sg. This X-Message-Id indicates that SendGrid has received the mail and will process it,
X-Message-Id will be considered as the key equivalent of the email, and will be used to get the status of the email.

The user will receive the mail and based on user action multiple events can happen, such as

Delivery Events       Engagement Events
Processed : Opened
Dropped : Clicked
Deferred : Unsubscribed
Bounced : Spam Reports
Delivered : Unsubscribes

To get the current status of the email, SendGrid provides an Event Notification Webhook Settings. With each action taken by the user, SendGrid will push an event on Webhook API.

To push response SendGrid requires a publically accessible URL which will be called back by the SendGrid service and post the current status of the email.

How to get Webhook callback URL

Webhook requires a live URL which it will call back to post Webhook event notification of the current email status.

  • Deploy the webhook consumer service on the prod environment.
  • Download Live Url Software like Ngrok and redirect API call on local machine.
  • Use Live WebHook testing Sites like webhook.site

follow us on