mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
SendinBlue: additional template/tags improvements
Additional changes related to SendinBlue improvements in #158: * Support multiple tags in webhooks (closes #162) * Remove additional outdated template code in backend * Update integration tests * Update docs and changelog; note breaking changes as discussed in #161
This commit is contained in:
@@ -49,10 +49,17 @@ class SendinBlueTrackingWebhookView(AnymailBaseWebhookView):
|
||||
except (KeyError, ValueError):
|
||||
timestamp = None
|
||||
|
||||
tags = []
|
||||
try:
|
||||
tags = [esp_event["tag"]]
|
||||
# If `tags` param set on send, webhook payload includes 'tags' array field.
|
||||
tags = esp_event['tags']
|
||||
except KeyError:
|
||||
tags = []
|
||||
try:
|
||||
# If `X-Mailin-Tag` header set on send, webhook payload includes single 'tag' string.
|
||||
# (If header not set, webhook 'tag' will be the template name for template sends.)
|
||||
tags = [esp_event['tag']]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
metadata = json.loads(esp_event["X-Mailin-custom"])
|
||||
|
||||
Reference in New Issue
Block a user