anymail / django-anymail

Django email backends and webhooks for Amazon SES, Brevo (Sendinblue), MailerSend, Mailgun, Mailjet, Postmark, Postal, Resend, SendGrid, SparkPost, Unisender Go and more
https://anymail.dev
BSD 3-Clause "New" or "Revised" License
1.65k stars 125 forks source link

Inaccuracy in documentation about Brevo's behaviour #344

Closed thibault closed 8 months ago

thibault commented 8 months ago

Hi,

We are using Anymail's status tracking webhook to count the number of times sent emails are opened.

However, an issue with first openings not being counted led me to find something that seems to be inaccurate in anymail's documentation.

Here is an excerpt from Brevo's related documentation:

If you are interested in tracking opens, note that Brevo has both a “First opening” and an “Opened” event type, and will generate both the first time a message is opened. Anymail normalizes both of these events to “opened.” To avoid double counting, you should only enable one of the two.

However, after a few tests, it seems to me that it's just not true.

Steps to reproduce

Here, anymail and django versions or any piece of code are irrelevant, because the issue is only with Brevo's behaviour as it is described in the documentation.

Thank you.

medmunds commented 8 months ago

@thibault thanks for reporting this. It seems that Brevo has changed how their open webhooks are handled since we first implemented them in Anymail. I am now seeing the same behavior as you. (Also, Brevo seems to have renamed the "Opened" event to "Known open" in their dashboard.)

We should update Anymail's docs to recommend enabling both "Known open" and "First opening" events for open tracking.

(As an aside, I always do a bunch of manual testing with webhook.site as part of implementing any ESP's webhooks in Anymail, because so far not a single ESP has had complete and accurate documentation for their webhook payloads. I'd like to find a way to add webhooks to Anymail's weekly live integration tests, to catch changes like this one.)

medmunds commented 8 months ago

Updated docs in 804cb76aa1935e40ff3cf2976aa05916daac24fc