aceofspades/sendgrid_postback — pull request #1 by aramisbear (2012-10-12 19:20:32+00:00)
Title: Allow settings to be enabled/disabled as needed

I integrated sendgrid_postback with an existing application that already had some fairly complex email handling. We're using Mailhopper to store outgoing emails, tacking the uuid, events, and state onto that email table so we can keep everything together, embedding other sendgrid headers (categories) into outgoing emails from a parent class, and also tracking the user_id with the outgoing user for most of their emails too.

When we first pulled in sendgrid_postback it was making a lot of assumptions about things working a particular way so we had to add configuration options that would allow us to turn off and replace parts of it (like the mail interceptor) and replace it with our own as needed.

Additionally, we use Sendgrid as the single delivery point for our entire company's infrastructure, so not all of the emails received by postback will be sent by the app (and therefore, will not have a uuid) so we modified the receiver to handle emails without a UUID differently (which we track in the sendgrid_reports table that we built to store reports from the sendgrid_toolkit gem).

Let me know what you think of the changes.