Postmark: don't error on Cc/Bcc-only send; preserve recipient caps

Postmark docs notwithstanding, Postmark allows sending mail without a
To field, as long as there is some recipient in Cc or Bcc. The API
response has a slightly different shape in this case, and Anymail now
handles that.

Also updates related recipient status parsing. Previously, Anymail's
Postmark backend converted all recipient emails to lowercase for status
reporting, and omitted Cc or Bcc recipients from
`message.anymail_status.recipients[email]`. Now, the backend preserves
the case of each recipient email as originally sent, and includes Cc
and Bcc status.

Because client code may have been relying on lowercasing recipient
emails to check status, this is a potentially breaking change.

Fixes #135
This commit is contained in:
medmunds
2019-02-05 11:08:26 -08:00
parent c5c015e9a1
commit f64e98141a
3 changed files with 84 additions and 17 deletions

View File

@@ -25,6 +25,28 @@ Release history
^^^^^^^^^^^^^^^
.. This extra heading level keeps the ToC from becoming unmanageably long
Unreleased
----------
*In development*
Breaking changes
~~~~~~~~~~~~~~~~
* **Postmark:** Anymail's `message.anymail_status.recipients[email]` no longer
lowercases the recipient's email address. For consistency with other ESPs, it now
uses the recipient email with whatever case was used in the sent message. If your
code is doing something like `message.anymail_status.recipients[email.lower()]`,
you should remove the `.lower()`
Fixes
~~~~~
* **Postmark:** Don't error if a message is sent with only Cc and/or Bcc recipients
(but no To addresses). Also, `message.anymail_status.recipients[email]` now includes
send status for Cc and Bcc recipients. (Thanks to `@ailionx`_ for reporting the error.)
v5.0
----
@@ -879,6 +901,7 @@ Features
.. _#112: https://github.com/anymail/issues/112
.. _#115: https://github.com/anymail/issues/115
.. _@ailionx: https://github.com/ailionx
.. _@calvin: https://github.com/calvin
.. _@costela: https://github.com/costela
.. _@decibyte: https://github.com/decibyte