mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Amazon SES: support headers with template
Use new SES v2 SendBulkEmail ReplacementHeaders param to support features that require custom headers, including `extra_headers`, `metadata`, `merge_metadata` and `tags`. Update integration tests and docs Closes #375
This commit is contained in:
@@ -164,6 +164,20 @@ class AmazonSESBackendIntegrationTests(AnymailTestMixin, SimpleTestCase):
|
||||
"success+to2@simulator.amazonses.com": {"order": 6789},
|
||||
},
|
||||
merge_global_data={"name": "Customer", "ship_date": "today"}, # default
|
||||
headers={
|
||||
"List-Unsubscribe-Post": "List-Unsubscribe=One-Click",
|
||||
},
|
||||
merge_headers={
|
||||
"success+to1@simulator.amazonses.com": {
|
||||
"List-Unsubscribe": "<https://example.com/unsubscribe/to1>"
|
||||
},
|
||||
"success+to2@simulator.amazonses.com": {
|
||||
"List-Unsubscribe": "<https://example.com/unsubscribe/to2>"
|
||||
},
|
||||
},
|
||||
tags=["Live integration test", "Template send"],
|
||||
metadata={"test": "data"},
|
||||
merge_metadata={"success+to2@simulator.amazonses.com": {"user-id": "2"}},
|
||||
)
|
||||
message.send()
|
||||
recipient_status = message.anymail_status.recipients
|
||||
|
||||
Reference in New Issue
Block a user