Closed originell closed 1 month ago
Thanks for catching these new Brevo events. Yes, a PR would be welcome. Your proposed mapping looks correct to me.
As to why "request" is mapped to QUEUED rather than SENT, I believe it's because "request" can be received even if Brevo doesn't actually plan to send the message. E.g., if the recipient is on Brevo's blocklist because a previous message to that address bounced or received a spam complaint, Brevo will send a "request" event immediately followed by a "blocked" event, without attempting to send the message. Anymail's EventType.SENT is supposed to be used only for messages that have truly been sent. (There's a comment alluding to that on the line above the "request" mapping. It used to be on the same line, but the Black formatter moved it and it's not so clear what it means now.)
Ahhhhh! Thanks for explaining.
I definitely did not catch this relation at first glance, but it makes complete sense.
Ok great, then I'll take care of creating a PR :)
(Released in Anymail 11.1. Thanks again!)
(Amazing! Thank you for making it easy)
Dear Team, first of all: great package. Been using it forever without a fail. Forever grateful!
While debugging an issue with the Brevo (ex SendInBlue) Webhooks, I've discovered 2 slightly related things I'd like to get your opinions about.
A) New Events PR
I noticed that Brevo now has a couple of new events that are not yet mapped in the webhook.
From what I've seen their docs, the new ones are:
complaint
error
proxy_open
I would suggest the following mapping updates:
complaint
:(EventType.COMPLAINED, RejectReason.SPAM)
error
:(EventType.FAILED, None)
proxy_open
:(EventType.OPENED, None)
If these seem OK to you as well, I'd be happy to supply a PR as well. Just wanted to get a quick OK before investing the time :)
B) The "request" Event Question
Looking at the webhook view's event type mapping, I see this mapping here:
I was wondering why this is mapped to QUEUED and not SENT? If you can still remember.
The current docs seem to suggest that the
request
payload is meant assent
.Thank you for taking the time maintaining this great package and also keeping the code as neat as it is!