mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Docs: Update Brevo opened event
Brevo has stopped sending the opened event on first open (along with the unique_opened event), so change docs to recommend enabling both.
This commit is contained in:
@@ -56,7 +56,7 @@ class SendinBlueTrackingWebhookView(SendinBlueBaseWebhookView):
|
|||||||
"unsubscribe": (EventType.UNSUBSCRIBED, None),
|
"unsubscribe": (EventType.UNSUBSCRIBED, None),
|
||||||
# shouldn't occur for transactional messages:
|
# shouldn't occur for transactional messages:
|
||||||
"list_addition": (EventType.SUBSCRIBED, None),
|
"list_addition": (EventType.SUBSCRIBED, None),
|
||||||
"unique_opened": (EventType.OPENED, None), # you'll *also* receive an "opened"
|
"unique_opened": (EventType.OPENED, None), # first open; see also opened above
|
||||||
}
|
}
|
||||||
|
|
||||||
def esp_to_anymail_event(self, esp_event):
|
def esp_to_anymail_event(self, esp_event):
|
||||||
|
|||||||
@@ -264,10 +264,13 @@ Be sure to select the checkboxes for all the event types you want to receive. (A
|
|||||||
sure you are in the "Transactional" section of their site; Brevo has a separate set
|
sure you are in the "Transactional" section of their site; Brevo has a separate set
|
||||||
of "Campaign" webhooks, which don't apply to messages sent through Anymail.)
|
of "Campaign" webhooks, which don't apply to messages sent through Anymail.)
|
||||||
|
|
||||||
If you are interested in tracking opens, note that Brevo has both a "First opening"
|
If you are interested in tracking opens, note that Brevo has both "First opening"
|
||||||
and an "Opened" event type, and will generate both the first time a message is opened.
|
and an "Known open" event types. The latter seems to be generated only for the second
|
||||||
Anymail normalizes both of these events to "opened." To avoid double counting, you should
|
and subsequent opens. Anymail normalizes both types to "opened." To track unique opens
|
||||||
only enable one of the two.
|
enable only "First opening," or to track all message opens enable both. (Brevo used to
|
||||||
|
deliver both events for the first open, so be sure to check their current behavior
|
||||||
|
if duplicate first open events might cause problems for you. You might be able to use
|
||||||
|
the event timestamp to de-dupe.)
|
||||||
|
|
||||||
Brevo will report these Anymail :attr:`~anymail.signals.AnymailTrackingEvent.event_type`\s:
|
Brevo will report these Anymail :attr:`~anymail.signals.AnymailTrackingEvent.event_type`\s:
|
||||||
queued, rejected, bounced, deferred, delivered, opened (see note above), clicked, complained,
|
queued, rejected, bounced, deferred, delivered, opened (see note above), clicked, complained,
|
||||||
|
|||||||
@@ -294,8 +294,9 @@ class SendinBlueDeliveryTestCase(WebhookTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_opened_event(self):
|
def test_opened_event(self):
|
||||||
# SendinBlue delivers unique_opened *and* opened on the first open. To avoid
|
# SendinBlue delivers 'unique_opened' only on the first open, and 'opened'
|
||||||
# double-counting, you should only enable one of the two events in SendinBlue.
|
# only on the second or later tracking pixel views. (But they used to deliver
|
||||||
|
# both on the first open.)
|
||||||
raw_event = {
|
raw_event = {
|
||||||
"event": "opened",
|
"event": "opened",
|
||||||
"email": "recipient@example.com",
|
"email": "recipient@example.com",
|
||||||
@@ -319,8 +320,7 @@ class SendinBlueDeliveryTestCase(WebhookTestCase):
|
|||||||
self.assertIsNone(event.user_agent) # SendinBlue doesn't report user agent
|
self.assertIsNone(event.user_agent) # SendinBlue doesn't report user agent
|
||||||
|
|
||||||
def test_unique_opened_event(self):
|
def test_unique_opened_event(self):
|
||||||
# SendinBlue delivers unique_opened *and* opened on the first open. To avoid
|
# See note in test_opened_event above
|
||||||
# double-counting, you should only enable one of the two events in SendinBlue.
|
|
||||||
raw_event = {
|
raw_event = {
|
||||||
"event": "unique_opened",
|
"event": "unique_opened",
|
||||||
"email": "recipient@example.com",
|
"email": "recipient@example.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user