Postmark: Fix Postmark error on empty subject/body with template_id.

Postmark issues an error if Django's default empty strings are used
with template sends.

Include template send in Postmark integration tests. (Requires real
Postmark API token -- templates aren't testable with Postmark's
sandbox token.)

Fixes #121
This commit is contained in:
medmunds
2018-09-05 12:41:33 -07:00
parent 8b7b833a2b
commit 753c895301
5 changed files with 53 additions and 21 deletions

View File

@@ -142,8 +142,8 @@ message attribute:
.. code-block:: python
message = EmailMessage(
...
subject=None, # use template subject
# (subject and body come from the template, so don't include those)
from_email="from@example.com",
to=["alice@example.com"] # single recipient...
# ...multiple to emails would all get the same message
# (and would all see each other's emails in the "to" header)
@@ -159,9 +159,7 @@ message attribute:
],
}
Set the EmailMessage's subject to `None` to use the subject from
your Postmark template, or supply a subject with the message to override
the template value.
Postmark does not allow overriding the message's subject or body with a template.
See this `Postmark blog post on templates`_ for more information.