mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
SendGrid: merge 'filters' in esp_extra
Previously, setting esp_extra['x-smtpapi']['filters'] would override the entire filters setting, potentially undoing other Anymail options that use SendGrid filters (like track_opens). Now, 'filters' is special-cased, and merged with any other Anymail filter options. (We don't do a fully deep merge, because otherwise there would be no way to use esp_extra to *clear* Anymail settings.)
This commit is contained in:
@@ -117,7 +117,16 @@ Example:
|
||||
message.esp_extra = {
|
||||
'x-smtpapi': {
|
||||
"asm_group": 1, # Assign SendGrid unsubscribe group for this message
|
||||
"asm_groups_to_display": [1, 2, 3]
|
||||
"asm_groups_to_display": [1, 2, 3],
|
||||
"filters": {
|
||||
"subscriptiontrack": { # Insert SendGrid subscription management links
|
||||
"settings": {
|
||||
"text/html": "If you would like to unsubscribe <% click here %>.",
|
||||
"text/plain": "If you would like to unsubscribe click here: <% %>.",
|
||||
"enable": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user