Closed vitaliyf closed 2 months ago
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.
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.
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 notreject_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.