Commit Graph

94 Commits

Author SHA1 Message Date
Mike Edmunds
d9a80e7347 Tests: Test release version of Django 4.2 2023-04-03 12:18:34 -07:00
Mike Edmunds
c59ad9e7a1 Release 9.1 2023-03-11 11:44:02 -08:00
Mike Edmunds
62bd0669af MailerSend: add support (new ESP for Anymail)
Closes #298
2023-03-10 17:22:20 -08:00
Mike Edmunds
ea446a94d3 Amazon SES: implement SES v2 API backend
* Add `anymail.backends.amazon_sesv2.EmailBackend` using SES v2 API
* Declare current SES v1 backend as "deprecated"

Closes #274
2023-02-26 14:16:46 -08:00
medmunds
353e793323 Docs: update absolute links to anymail.dev
Canonical hosting for docs moved from anymail.readthedocs.io
to anymail.dev in May 2022.
2023-02-08 11:25:11 -08:00
medmunds
b1f49b8870 Tests: test Django 4.2-alpha, Python 3.11, PyPy 3.9 2023-02-08 11:05:18 -08:00
medmunds
40891fcb4a Apply code styles via pre-commit
- Add black and isort for Python styling
- Add doc8 for reStructuredText styling
- Add prettier for css/html/js/md/yaml styling
- Run all styling tools from pre-commit hooks
- Adjust flake8 config for compatibility with black
  (and current Django style)
- Add some other helpful pre-commit hooks
- Update editorconfig to match Django
  (with a few necessary adjustments for Anymail)
- Update `tox -e lint` to run all pre-commit hooks
- Update contributing docs
2023-02-06 15:05:24 -08:00
medmunds
52c7c11312 Release 9.0 2022-12-18 16:27:36 -08:00
medmunds
287c2175f4 Sendinblue: Support send_at
Add support for delayed sending via
Sendinblue's public beta "scheduledAt"
parameter.

Closes #280
2022-12-18 15:53:45 -08:00
medmunds
681a4afe6b Sendinblue: fix "invalid headers" error
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
2022-11-04 16:46:25 -07:00
medmunds
3f05623a2f Drop support for Django 2.x and Python 3.5 2022-08-29 13:25:47 -07:00
Tim Schilling
a4f50c4340 Confirm support for Django 4.1
Replaces deprecated `django.utils.timezone.utc` with
`datetime.timezone.utc` (available since Python 3.2).
2022-08-24 13:24:27 -07:00
David Gilman
e3cd4df1fc Allow requests session customization, document use for automatic retries
* Refactor create_session() out of AnymailRequestsBackend
* Document automatic retries with Requests
2022-06-26 18:52:46 -07:00
puru02
48de044c9b Fix: Postmark tracking webhook handle SubscriptionChange events
Handle Postmark SubscriptionChange events as Anymail 
unsubscribe, subscribe, or bounce Anymail tracking events.
2022-06-07 17:28:39 -07:00
medmunds
ad08892eb0 Release 8.6 2022-05-15 10:11:00 -07:00
medmunds
09f21a5c2d Mailgun/SendGrid inbound: workaround Django filename issue
Workaround for Django multipart/form-data limitation
where certain attachment filenames cause fields to be dropped
or to end up in request.POST rather than request.FILES.

Handle the MultiValueDictKeyError in inbound webhooks when
this has occurred. Also update docs to recommend avoiding
the problem by using Mailgun and SendGrid's "raw MIME" options.

Also handle reported cases of empty, duplicate keys in Mailgun's
content-id-map.

Fixes #272
2022-05-13 10:19:12 -07:00
medmunds
6a2e30ba8f Docs: note Mailgun broken display name encoding
Document that Mailgun's API can mis-encode
display names containing both punctuation and
non-ASCII characters.

Closes #270
2022-05-03 15:27:05 -07:00
medmunds
33af7c387d Docs: note Mandrill broken attachment filenames 2022-05-03 13:20:31 -07:00
medmunds
3572ec59c9 Release 8.5 2022-01-19 14:57:24 -08:00
medmunds
d3730f08a2 Docs: cover testing tracking and inbound webhooks 2022-01-19 14:49:50 -08:00
medmunds
a868bf3bca Docs: cover Postmark limitation on track_opens
Note that Postmark doesn't support `track_opens = False`
when open tracking is enabled at the server level.
(But does support the opposite usage.)
2022-01-19 14:49:50 -08:00
medmunds
dc0a46a815 Feature: add is_batch_send to anymail_test_params
Make it easier for tests to check whether messages
would fall under Anymail's batch-send logic.

See #249.
2022-01-11 19:54:39 -08:00
medmunds
10f569cd50 Fix: don't include sender/recipient in AnymailError description
Remove `AnymailError.describe_send`, which added sender and
recipient email addresses to every AnymailError message
(whether or not relevant to the error).

Addresses #245
2022-01-11 17:03:03 -08:00
medmunds
60fbe1e896 Fix: treat first text/plain alternative as plaintext body
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
2022-01-10 15:35:00 -08:00
medmunds
26d2b5caa0 Release 8.4 2021-06-15 16:34:12 -07:00
Tilmann Becker
e90c10b546 Add Postal support
Thanks to @tiltec for researching, implementing, testing and documenting it.
2021-06-07 17:11:35 -07:00
medmunds
f831fe814a Release 8.3 2021-05-19 13:51:45 -07:00
Mike Edmunds
44754c908e Postmark: fix silent failures for send-time validation errors
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.
2021-05-19 13:15:34 -07:00
Mike Edmunds
b1a4f9809a Amazon SES: confirm webhook subscriptions in SNS topic's own region (#236)
Allow inbound and tracking webhooks using SNS topics from any AWS region.
The topic subscription must be confirmed in the topic's own region (not
the boto3 default), determined by examing the topic's ARN.

Fixes #235
2021-04-11 13:02:56 -07:00
medmunds
f4c99abddf Postmark: Fix incorrect single 'to' handling with template but no merge data
Fixes #227
2021-02-24 12:30:05 -08:00
medmunds
9ed5ce0213 Postmark: Fix API error with template but no merge data
Fixes #223
2021-02-22 17:50:46 -08:00
medmunds
4dd1d3b1fe Release 8.2 2021-01-27 14:43:44 -08:00
medmunds
4f349358bd Docs: document AMPHTML
* Add general instructions for sending AMP Email
  with Django
* Document ability of Amazon SES and SendGrid backends
  to send AMPHTML (via arbitrary alternative parts)
* Add AMP Email row to ESP support table
2021-01-27 14:37:16 -08:00
medmunds
d1ef61d3ba Mailgun: add AMPHTML support 2021-01-27 14:37:16 -08:00
medmunds
d33c9ea4ed Mailgun: improve API error messages 2021-01-27 14:37:16 -08:00
medmunds
f039366bf0 Test against Django 3.2 prerelease
* Omit default_app_config under Django 3.2 and later
  to avoid DeprecationWarning
* Also adds testing on Python 3.9, 3.10-alpha
* Also updates test matrix to include all supported
  Python versions (some older Django versions expanded
  Python support in patch releases)
2021-01-26 13:55:17 -08:00
medmunds
fb5912f0e7 Internal: validate AnymailRecipientStatus at init
Catch invalid message_id and status when initializing
AnymailRecipientStatus, so problems with ESP response
are caught earlier (in individual backend
parse_recipient_status, rather than base backend _send).
2021-01-26 13:55:17 -08:00
Mike Edmunds
5cbaa24002 Move CI testing to GitHub Actions
Related changes:
* remove Travis-CI config; stop running tests on Travis
* rename live integration test environment variables
  to all start with `ANYMAIL_TEST_` (simplifies tox config)
2020-11-28 18:08:01 -08:00
Mike Edmunds
8c1749c6f3 SparkPost: drop support for multiple from_email (#213)
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
2020-11-28 18:02:59 -08:00
medmunds
a7ea862ff1 Release 8.1 2020-10-09 12:07:00 -07:00
slinkymanbyday
b9fdd3a37e SparkPost: initial open and AMP tracking events
* Add SPARKPOST_TRACK_INITIAL_OPEN_AS_OPENED boolean
  setting, default False, controlling whether to report
  SparkPost "Initial Open" events as Anymail "opened".
* Add mapping for SparkPost "AMP Click", "AMP Open",
  and "AMP Initial Open" events.
* Update outdated doc references to SparkPost site

Closes #206
2020-09-18 15:25:25 -07:00
medmunds
945e69f591 Release 8.0 2020-09-11 14:50:20 -07:00
medmunds
985143b234 SparkPost: add subaccount support 2020-09-11 11:10:24 -07:00
medmunds
61660cd5ff SparkPost: call HTTP API directly [breaking]
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
2020-09-11 11:10:24 -07:00
Mike Edmunds
bc1156149a Mailjet: Upgrade to Send API v3.1 [breaking]
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
2020-09-08 14:50:26 -07:00
Mike Edmunds
cca653fcba Docs: update tooling and outdated/broken content
* Update docs build config
  * Specify Sphinx and theme versions in docs/requirements.txt
    (tox had been using latest; RTD had pinned older versions)
  * Update docs builds for Python 3 and recent Sphinx
  * Remove obsolete sphinx-rtd-theme patches
  * Add .readthedocs.yml
  * Move some JS to async (now that Sphinx supports that)
  * Fix version-alert.js for async loading
* Remove docs versionadded/changed info older than v3.0
* Fix broken GitHub issue links in changelog (never worked?)
* Add setup long_description_content_type
* Drop poorly maintained AUTHORS.txt 
  (just point to GitHub contributors page)
2020-09-07 12:05:39 -07:00
medmunds
48a9aaebf4 (Cherry pick v7.2.1) 2020-08-05 12:51:58 -07:00
Mike Edmunds
85cec5e9dc Drop Python 2 and Django 1.11 support
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)
2020-08-01 14:53:10 -07:00
medmunds
1dbb92cfb1 Release 7.2 2020-07-25 11:46:19 -07:00
Mike Edmunds
743d3ce21f SendGrid: fix inbound webhook Unicode error when not utf-8
Fix a crash or text-mangling issue when an inbound message
uses a charset other than utf-8 for its text or html body,
and SendGrid's "post raw" inbound parse option is *not*
enabled.

Update docs to recommend "post raw" option.

Fixes #187
2020-07-24 17:32:45 -07:00