Skip to content
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

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

SendGrid API response handling #664

wants to merge 6 commits into from

Conversation

nicbavetta
Copy link

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

  1. ISendGridResponseHandler - This interface can be implemented to allow business logic to be executed against responses from the SendGrid API.

  2. 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

  1. The ISendGridClient and SendGridClient have been removed in favor of leveraging the client interface/implementation provided by the SendGrid SDK.
  2. Namespaces in this project have been made to be consistent.
  3. As mentioned previously, SendGrid response status code evaluation has been changed to >= 400, per SendGrid documentation.
  4. Some null-checks have been added in modified constructors to better convey explicit requirements.

@net-foundation-cla
Copy link

net-foundation-cla bot commented Sep 22, 2020

CLA assistant check
All CLA requirements met.

@nicbavetta
Copy link
Author

nicbavetta commented Sep 27, 2020

@mathewc or @brettsam - Any chance this PR can get evaluated? The unsuccessful checks from the AppVeyor build are not related to my work.

Copy link
Member

@fabiocav fabiocav left a 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!

@nicbavetta
Copy link
Author

nicbavetta commented Feb 15, 2021

@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!

See #709 for the new PR. @fabiocav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants