You can create an iHook receiver to receive SendGrid Event Webhooks, and send email/Slack notifications whenever a SendGrid event is fired.
1. Create receiver
After signing into the iHook dashboard, go to the
Receiver tab, and click the
CREATE RECEIVER button at the top left corner:
A new receiver will be created. Under the
Receiver Settings section, you can see the receiver's unique URL, which you will use to receive SendGrid events. The endpoint accepts
EDIT button at the top right corner of the
Receiver Settings section, and provide the following values:
|Name||The name of the receiver.|
|Status Code||The response status code of the endpoint.|
|Content Type||The response content type of the endpoint. The value will appear in response header |
|Response Body||The response body to be sent back to SendGrid. You may leave this field as empty.|
SAVE. With the new settings, the receiver will respond to HTTP callers (SendGrid) with a
200 status code and empty response body.
2. Setup notification
Next let us set up an email notification, so we can be notified whenever the receiver gets a SendGrid event.
Notification section, click on
ADD button next to
Then a notification setup dialog will show up:
Enter your email address, and click
SAVE, you will see the new notification appear under the
Note that in the message template, you can use JSON path expression to extract desired objects/properties in
3. Register a SendGrid Event Webhook
Now you can register your receiver URL in your SendGrid account. Go to your SendGrid Event Webhook setting page (Settings -> Mail Settings -> Event Webhook), provide the following values:
|Authorization Method||No authorization method.|
|HTTP Post URL||The iHook receiver URL.|
|Deliverability Data||Tells SendGrid to notify the iHook receiver whenever an SendGrid email delivery is dropped or bounced.|
Test Your Integration, you should receive an email that contains the test data generated by the SendGrid event webhook.
Finally, toggle the SendGrid Event Webhook status to
ENABLED, and click
Congratulations! You've successfully created a receiver that accepts SendGrid Event Webhooks, with email notification enabled!