mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
SparkPost: remove empty content params with template_id
When using a stored template, SparkPost disallows subject, text, and html. Django's EmailMessage default empty strings are enough to provoke "Both content object and template_id are specified" from SparkPost, so remove them (if empty) when using stored templates. Update docs and tests; add integration test for template_id. Fixes #24
This commit is contained in:
@@ -140,8 +140,11 @@ and :ref:`batch sending <batch-send>` with per-recipient merge data.
|
||||
|
||||
You can use a SparkPost stored template by setting a message's
|
||||
:attr:`~anymail.message.AnymailMessage.template_id` to the
|
||||
template's unique id. Alternatively, you can refer to merge fields
|
||||
directly in an EmailMessage---the message itself is used as an
|
||||
template's unique id. (When using a stored template, SparkPost prohibits
|
||||
setting the EmailMessage's subject, text body, or html body.)
|
||||
|
||||
Alternatively, you can refer to merge fields directly in an EmailMessage's
|
||||
subject, body, and other fields---the message itself is used as an
|
||||
on-the-fly template.
|
||||
|
||||
In either case, supply the merge data values with Anymail's
|
||||
|
||||
Reference in New Issue
Block a user