Add new `merge_headers` message option
for per-recipient headers with template sends.
* Support in base backend
* Implement in Amazon SES backend
(Requires boto3 >= 1.34.98.)
---------
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
(See previous commit.)
- Maintain deprecated compatibility
versions on the old names/URLs.
(Split into separate commit
to make renamed files more
obvious.)
- Replace "SendinBlue" with "Brevo"
throughout the code.
- Maintain deprecated compatibility
versions on the old names/URLs.
(Split into separate commit
to make renamed files more
obvious.)
- Update docs to reflect change,
provide migration advice.
- Update integration workflow.
Replace generic `combine` with
specific `merge_dicts_deep`,
`merge_dicts_shallow`,
`merge_dicts_one_level` or
`concat_lists`, depending on
appropriate behavior for each
message attribute.
Fixes merging global `SEND_DEFAULTS`
with message `esp_extra` for ESP APIs
that use nested payload structures.
And clarifies intent for other properties.
* Update docs to (usually) refer to Brevo rather than Sendinblue
* Change SENDINBLUE_API_URL to api.brevo.com
(same API is available on both domains)
* Leave code references (settings, backend name, webhook urls)
unchanged as `sendinblue`, to avoid unnecessary client changes
- Rename `anymail.backends.amazon_sesv2.EmailBackend`
to `amazon_ses`, making SES v2 the default.
- Rename the old `amazon_ses` backend to `amazon_sesv1`,
keeping it available. Add a deprecation warning.
- Alias `amazon_sesv2` to `amazon_ses`, with a
deprecation warning (for projects that opted
into v2 early under Anymail 9.1 or 9.2).
- Similar renaming on the test files.
- Update docs to assume v2 in most places
(other than migration-specific sections)
Switch to pyproject.toml packaging, using hatchling.
- Replace all uses of setup.py with updated equivalent
- BREAKING: Change extra name `amazon_ses` to
`amazon-ses`, to comply with Python packaging
name normalization
- Use hatch custom build hook to freeze version number
in readme (previously custom setup.py code)
- Move separate requirements for dev, docs, tests
into their own requirements.txt files
- Fix AnymailImproperlyInstalled to correctly refer
to package extra name
- Update testing documentation
- Update docs readme rendering to match PyPI
(and avoid setup.py)
- In tox tests, use isolated builds and update pip
- Remove AUTHORS.txt (it just referred to GitHub)
Work around recent (unannounced) Sendinblue API change
that caused "Invalid headers" API error with non-string
custom header values, by converting basic numeric types
to strings. (Borrowed code from SendGrid backend.)
Fixes#288
Improve handling of alternative parts and `content_subtype`
to match how Django's SMTP backend handles some unusual cases.
Change Test backend to support (and record) text/* alternative
parts. (But still reject other types of alternatives.)
Fixes#252
Postmark uses their ErrorCode 300 to report several different
send-time validation errors, some of which identify invalid
recipients that need to be handled specially, but many of which
are ordinary API errors.
Rework the logic for parsing ErrorCode 300 error messages:
Handle only "Invalid 'To'" or "Error parsing 'To'" (or 'Cc'
or 'Bcc') as recipient errors. Otherwise raise an API error.
Fixes#238 silent failure when sending with long metadata keys.
SparkPost's API no longer allows this, and now returns
a confusing error message about return_path.
(Not treating as a breaking change in Anymail, because
the breaking change was in the SparkPost API. This just
improves the error message in the unlikely event anyone
is trying to use this feature.)
Closes#212
Switch from the (now unmaintained) python-sparkpost
client library to a requests-based backend that calls
SparkPost's Transmissions API directly.
Also adds support for text/x-amp-html alternative parts
(which are supported by the SparkPost API, but weren't
by the client library).
Closes#203
Switch from Mailjet's older v3.0 Send API to the newer v3.1 version.
This is a breaking change for code using the Mailjet backend and:
* Using `esp_extra`, which must be updated to the new API format
* Using multiple `reply_to` addresses, which the v3.1 API doesn't allow
Closes#81
Minimum supported versions are now Django 2.0, Python 3.5.
This touches a lot of code, to:
* Remove obsolete portability code and workarounds
(six, backports of email parsers, test utils, etc.)
* Use Python 3 syntax (class defs, raise ... from, etc.)
* Correct inheritance for mixin classes
* Fix outdated docs content and links
* Suppress Python 3 "unclosed SSLSocket" ResourceWarnings
that are beyond our control (in integration tests due to boto3,
python-sparkpost)
Fix TypeError when sending to or from addresses with
display names containing commas. Rewrite Anymail's
workaround for Mailjet's problem with commas in display
names, to avoid calling Django's internal sanitize_address
in an unsupported way.
The TypeError results from Django changes that will be
introduced in Django 2.2.15, 3.0.9, and 3.1.
In SendGrid backend, support non-batch template send to multiple
recipients when `merge_global_data` is set without `merge_data`.
Regression introduced in v6.0.
Fixes#179
Additional changes related to SendinBlue improvements in #158:
* Support multiple tags in webhooks (closes#162)
* Remove additional outdated template code in backend
* Update integration tests
* Update docs and changelog; note breaking changes as discussed in #161
urllib3 v1.25 fixes non-ASCII filenames in multipart form data to be
RFC 5758 compliant by default, so our earlier workaround is no longer
needed. Disable the workaround if we detect that Requests is using a
fixed version of urllib3.
Closes#157
Mailgun has two different template mechanisms and two different ways
of providing substitution variables to them. Update Anymail's
normalized merge_data handling to work with either (while preserving
existing batch send and metadata capabilities that also use Mailgun's
custom data and recipient variables parameters).
Completes work started by @anstosa in #156.
Closes#155.
Track Sendinblue API updates:
* Multiple tags are now supported
* When using a template, display name is now supported on 'to', 'bcc', 'cc' and 'replyTo'
* Templates now support overriding 'from_email' and 'subject'
* Templates no longer require separate API endpoint
* 'merge_global_data' can be used without templates