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:
Mike Edmunds
2019-09-04 15:45:08 -07:00
committed by GitHub
parent fd558e904e
commit 0a8887913c
7 changed files with 127 additions and 53 deletions

View File

@@ -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"])