anymail / django-anymail

Django email backends and webhooks for Amazon SES, Brevo (Sendinblue), MailerSend, Mailgun, Mailjet, Postmark, Postal, Resend, SendGrid, SparkPost, Unisender Go and more
https://anymail.dev
BSD 3-Clause "New" or "Revised" License
1.65k stars 125 forks source link

Amazon SES: support extra_headers, metadata, tags for template sends #375

Closed medmunds closed 2 months ago

medmunds commented 3 months ago

Originally, AWS's ses::SendBulkEmail API didn't allow specifying email headers. Since Anymail's Amazon SES backend also uses custom headers for metadata and tags, this meant you couldn't use any of the following message options together with a template_id:

In March, AWS added a new ReplacementHeaders parameter for ses::SendBulkEmail, which allows per-recipient custom headers. In early May, the new parameter was made available in boto3.

Anymail should use SES's new ReplacementHeaders to support extra_headers, metadata, merge_metadata, and tags in template sends.

(Related: #371)