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: better handling of event="dropped", reason="Bounced Address" webhook events. #379

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

vitaliyf
Copy link
Contributor

According https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#dropped the correct "reason" value for bouncing addresses is "Bounced Address" and that seems to be what I am seeing in SendGrid logs. Without this change those events were being normalized by anymail to type=dropped, reject_reason=other and not reject_reason=bounced.

I used sample event from their docs, and kept original mapping value since I'm not sure if that may actually show up in other situations.

…hook events.

According https://www.twilio.com/docs/sendgrid/for-developers/tracking-events/event#dropped the
correct "reason" value for bouncing addresses is "Bounced Address" and that seems to be what I
am seeing in SendGrid logs. Without this change those events were being normalized by anymail to
`type=dropped, reject_reason=other` and not `reject_reason=bounced`.
@vitaliyf vitaliyf changed the title SendGrid: better handle event="dropped", reason="Bounced Address" webhook events. SendGrid: better handling of event="dropped", reason="Bounced Address" webhook events. Jun 15, 2024
@medmunds
Copy link
Contributor

Thanks for this.

The tests are all based on actual webhook payloads observed when SendGrid support was first implemented (because the specific payload values weren't documented). It seems like they've added some values since then, but I agree it doesn't hurt to keep supporting the old "bounced" reason as well.

@medmunds medmunds merged commit 6e696b8 into anymail:main Jun 20, 2024
61 checks passed
@vitaliyf
Copy link
Contributor Author

Thank you for this project - I was only making tweaks in an inherited codebase, and it was great to discover that we used this nice library that encapsulates such secondary functionality as webhook handling.

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

Successfully merging this pull request may close these issues.

2 participants