-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unofficial brevo first open via proxy.
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -435,6 +435,39 @@ def test_proxy_open_event(self): | |
event = kwargs["event"] | ||
self.assertEqual(event.event_type, "opened") | ||
|
||
def test_unique_proxy_open_event(self): | ||
# Sadly, undocumented in Brevo. | ||
# Equivalent to "First Open but loaded via Proxy". | ||
# This is sent when a tracking pixel is loaded via a 'privacy proxy server'. | ||
# This technique is used by Apple Mail, for example, to protect user's IP | ||
# addresses. | ||
raw_event = { | ||
"event": "unique_proxy_open", | ||
"email": "[email protected]", | ||
"id": 1, | ||
"date": "2020-10-09 00:00:00", | ||
"message-id": "[email protected]", | ||
"subject": "My first Transactional", | ||
"tag": ["transactionalTag"], | ||
"sending_ip": "xxx.xxx.xxx.xxx", | ||
"s_epoch": 1534486682000, | ||
"template_id": 1, | ||
} | ||
response = self.client.post( | ||
"/anymail/brevo/tracking/", | ||
content_type="application/json", | ||
data=json.dumps(raw_event), | ||
) | ||
self.assertEqual(response.status_code, 200) | ||
kwargs = self.assert_handler_called_once_with( | ||
self.tracking_handler, | ||
sender=BrevoTrackingWebhookView, | ||
event=ANY, | ||
esp_name="Brevo", | ||
) | ||
event = kwargs["event"] | ||
self.assertEqual(event.event_type, "opened") | ||
|
||
def test_clicked_event(self): | ||
raw_event = { | ||
"event": "click", | ||
|