kunal
kunal

Reputation: 123

SendGrid - Custom Event Notification App in header

I am trying to use SendGrid's Event Notification App (http://sendgrid.com/documentation/display/apps/EventNotification) for emails of certain categories. The Event Notification on my SendGrid account is empty. The header I'm putting on my email is:

X-SMTPAPI: {"category":"category","filters":{"eventnotification":{"settings":{"url":"theurl"}}}}

But I'm not getting a callback on my url. A simple curl post on this given url gives me the expected output, so I'm pretty sure that should be working with SendGrid too.

Do you have any ideas on what the header should look like? I couldn't find too much documentation on the website for this specific app...

Thanks!

Upvotes: 0

Views: 840

Answers (1)

Joshua Harris
Joshua Harris

Reputation: 409

Here is an example of the header that I am successfully sending with my Sendgrid emails:

headers("X-SMTPAPI" => "{\"unique_args\": {\"customer_id\":\"#{customer.id}\",\"email_batch_id\":\"#{batch_id}\"}, \"category\":\"monthly_statement\"}")

Make sure you have the correct events checked under the event notification settings in Sendgrid.

Upvotes: 0

Related Questions