-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SendGrid API response handling #664
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicbavetta thank you for the contribution!
Looks like the scope of the changes was inflated by some other refactoring.
Could you please remove the refactoring that isn't directly related to the work? Any refactoring work can be submitted as a separate PR.
This change also introduces a lot of type name/namespace changes, which would need to be removed as those are breaking within a major version.
Thanks!
|
This pull request contains modifications to enable extensibility through SendGrid API response handling. Previously, if a response from the SendGrid API indicated a result other than success (defined, by this extension, as status code >= 300), an exception would be thrown when the SendGridMessageAsyncCollector was flushed. This implementation made it difficult to react to responses in meaningful ways.
Additions
ISendGridResponseHandler - This interface can be implemented to allow business logic to be executed against responses from the SendGrid API.
DefaultSendGridResponseHandler - The default implementation for the interface above. If consumers of this extension do not implement and register the ISendGridResponseHandler with DI, then the DefaultSendGridResponseHandler will be used. This handler implements the logic that was previously implemented when SendGrid responses were received with status codes >= 300. The status code evaluation has been changed to >= 400, per SendGrid documentation.
Modifications