Commit Graph

265 Commits

Author SHA1 Message Date
David Jean Louis
5949069321 Mailgun: fix webhook error with null delivery-status
Mailgun now sometimes posts `"delivery-status": null` 
in the tracking event payload. Avoid raising an AttributeError
when that occurs.

Fixes #361
2024-03-05 13:58:41 -08:00
Arondit
a71a0d9af8 Unisender Go: new ESP
Add support for Unisender Go

---------

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
2024-03-05 11:38:40 -08:00
Mike Edmunds
706fce60ac Resend: support batch send
Add support for `merge_metadata`
and new Resend email/batch API.
2024-02-19 16:41:22 -08:00
Mike Edmunds
4f305131ee Brevo: add batch send support
Closes #353
2024-02-19 11:52:10 -08:00
Mike Edmunds
804cb76aa1 Docs: Update Brevo opened event
Brevo has stopped sending the opened
event on first open (along with the
unique_opened event), so change docs
to recommend enabling both.
2023-12-29 11:28:40 -08:00
Mike Edmunds
e15b3ce1ec Release 10.2 2023-10-25 13:01:30 -07:00
Mike Edmunds
b5ef492466 Resend: new ESP (#341)
Add support for Resend.com backend and webhooks.

Closes #341
2023-10-25 12:23:57 -07:00
Mike Edmunds
823a161927 Fix global SEND_DEFAULTS merging
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.
2023-10-19 14:33:50 -07:00
Mike Edmunds
f911ee78a0 Fix Python 3.12 deprecation warning 2023-09-22 11:08:20 -07:00
Mike Edmunds
de44b938e9 Release 10.1 2023-07-31 10:45:38 -07:00
Mike Edmunds
05afde0651 SendGrid: support multiple reply_to
Closes #325
2023-07-27 18:37:31 -07:00
Mike Edmunds
c8a5e13c89 Brevo: add inbound support
(Also adds "responses" to test requirements,
for mocking fetches of Brevo inbound
attachments.)

Closes #322
2023-07-27 18:26:57 -07:00
Léo Martinez
0ac248254e Inbound: improve inline content handling
* refactor: derive `AnymailInboundMessage` from `email.message.EmailMessage`
  rather than legacy Python 2.7 `email.message.Message`

* feat(inbound): replace confusing `inline_attachments` with `content_id_map`
  and `inlines`; rename `is_inline_attachment` to `is_inline`; deprecate old names 

Closes #328

---------

Co-authored-by: Mike Edmunds <medmunds@gmail.com>
2023-07-27 15:10:58 -07:00
sblondon
8a72f89e8a Sendinblue: rename to Brevo
* 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
2023-06-13 13:04:52 -07:00
Mike Edmunds
099ef314e4 Release 10.0 2023-05-07 12:09:28 -07:00
Mike Edmunds
744d467f70 Postmark inbound: improve inbound parsing
- Support Postmark's RawEmail option;
  recommend it in docs
- Handle Bcc when provided by Postmark
- Obtain `envelope_sender` from Return-Path info
  Postmark now adds, rather than parsing Received-SPF

Related:
- Add `AnymailInboundMessage.bcc` convenience prop
- Test against full Postmark "check" inbound payloads
  (which don't match their docs or real inbound payloads)
- Don't warn about receiving "check" payload
2023-05-06 11:40:00 -07:00
Mike Edmunds
746cf0e24e Mandrill: drop Djrill compatibility 2023-05-04 13:08:05 -07:00
Mike Edmunds
41754d9813 Amazon SES: use SES v2 API by default
- 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)
2023-05-04 12:27:55 -07:00
Mike Edmunds
e8df0ec8e0 Modernize packaging
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)
2023-05-03 16:55:08 -07:00
Mike Edmunds
9fba58237d Drop support for Python 3.6 and old urllib3 2023-05-02 13:59:01 -07:00
Mike Edmunds
485766182e Release 9.2 2023-05-02 13:03:31 -07:00
Mike Edmunds
7d993ee610 Fix fail_silently when session/client creation fails
Make sure backends actually fail silently when asked
(rather than raising inaccurate errors suggesting
coding problems).

Fixes #308
2023-05-02 12:38:18 -07:00
Mike Edmunds
1ba26e1be3 Fix empty strings in AnymailInboundMessage from/to/cc
Fix AnymailInboundMessage.to, .cc, .from_email when
message was built with AnymailInboundMessage.construct
using empty strings for those params. (Postmark inbound
relies on this.)

Fixes #307
2023-05-02 11:42:00 -07:00
Mike Edmunds
fdac3bfe37 Import make_msgid from correct package 2023-05-02 11:26:29 -07:00
Therry van Neerven
885eb9b98a Postmark: workaround invalid "test inbound" data
Postmark's "test" button in their inbound settings
posts data with attachments that don't match their docs or
actual inbound behavior. Accept that and issue a warning.

Closes #304
2023-04-22 12:00:05 -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
f5f3fc86e6 Simplify url patterns
Favor `django.urls.path` over `re_path` where possible.
2023-02-08 14:23:15 -08:00
medmunds
b4e22c63b3 Reformat code with automated tools
Apply standardized code style
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
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
41147b581c Mandrill: don't send unnecessary empty fields
Don't add empty Reply-To header and empty display names
to Mandrill send API data.

Fixes #262
2022-02-02 16:36:11 -08:00
medmunds
3572ec59c9 Release 8.5 2022-01-19 14:57:24 -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