Closed edgward closed 10 years ago
Just found the Sendgrid Event Notification settings page and turned all of them off, so I should be good for now.
However, if I did want to use event notifications, I could see this being an issue. Is there a way to configure Griddler or the Griddler adapter so these come through correctly?
Hi @edgward. Griddler is designed to process incoming emails, not incoming events. It expects a payload that looks like:
{
"headers": "Received: by 127.0.0.1 with SMTP...",
"to": "Another Person <another-person@example.com>",
"from": "A Person <person@example.com>",
"subject": "hello there",
"text": "this is an email message",
"html": "<p>this is an email message</p>",
"SPF": "pass"
}
There's an exception because SendGrid events are not email :smile: The payload is quite different:
[
{
"email": "person@example.com",
"timestamp": 1337197600,
"smtp-id": "<4FB4041F.6080505@sendgrid.com>",
"event": "delivered"
}
]
If you're interested in processing SendGrid events, I think the best approach would be to create a separate endpoint in your application for those events and configure SendGrid to post events to that endpoint. Griddler will not be able to handle these events unfortunately.
@chrishunt Ah, that helps clarify things. Thanks for explaining that! Will go ahead and close the issue then.
To go one step further, it's likely that your SendGrid setup is such that you're sending an events api to /email_processor.
If you have a compelling reason to consume these events, then you should set up another endpoint. If you don't or aren't sure, they're probably safe to ignore.
Thanks @calebthompson. Exactly right, events were POSTing to the same endpoint url -- I don't need them at the moment so I turned all event notifications off via Sendgrid's website. In the future, if I need to consume them, I'll change the endpoint url and create a separate handler method for events.
Extremely helpful, guys. Thanks again!
Hi,
I'm just starting out with Rails and playing with different gems so this might be user-error, but I keep getting NoMethodError (undefined method 'split' for nil:NilClass) and it appears to be in the gem code.
Looks like it's due to the "event"=>"delivered" notifications I get back after sending out an email.
Is this an issue or something I should resolve via an email setting I've missed? Would appreciate any advice. Thanks!