Allow settings to be enabled/disabled as needed #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.