Commit Graph

820 Commits

Author SHA1 Message Date
medmunds
088d3c8eb9 Cleanup: add reprs for AnymailStatus, AnymailRecipientStatus 2020-09-11 14:26:55 -07:00
medmunds
03dd15d485 Cleanup: add reprs for Attachment, EmailAddress 2020-09-11 14:26:55 -07:00
medmunds
feee8b5c5a Cleanup: simplify requests backend raise_for_status
Treat all 2xx (not just 200) as success in base
AnymailRequestsBackend.raise_for_status, eliminating
some unnecessary subclass overrides.
2020-09-11 14:26:55 -07:00
medmunds
a14276e765 Cleanup: remove unused MailjetPayload property 2020-09-11 14:26:55 -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
medmunds
470ed2c6e6 Test utils: add assertDictMatches 2020-09-11 11:10:24 -07:00
medmunds
be7f2516b0 Add Attachment.content_type 2020-09-11 11:10:24 -07:00
medmunds
5b04ae30f2 Ensure EmailAddress can't contain newlines 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
mike w
963b8b4b50 docs: fix documentation for anymail_test_params 2020-09-05 10:22:37 -07:00
medmunds
7d726734eb Rename git default branch to "main" 2020-08-14 17:58:06 -07:00
medmunds
9095974d4a Travis: run on vX.Y.x branches, too
E.g., "v7.2.x"

(Cherry picked from v7.2.x branch)

[ci skip]
2020-08-05 12:55:16 -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
c803108481 SparkPost: reduce live integration test volume
SparkPost has a very small monthly send allowance (and no
API test mode), so limit the number of recipients in live
integration tests to avoid running through our whole quota.

This means we aren't fully testing cc and bcc handling like
we're able to for other ESPs.
2020-07-29 14:41:35 -07:00
medmunds
b9cba8243d Docs: Amazon SES webhooks: warn about SNS console bug
Add a warning about a bug in the AWS SNS console that
converts part of the webhook secret to asterisks.

Closes #194
2020-07-29 14:32:22 -07:00
medmunds
bb20ebf0e9 Docs: clarify behavior of Anymail's added send options 2020-07-29 14:25:25 -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
medmunds
c4ed6660b3 Mailjet: fix TypeError in sanitize_address
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.
2020-07-23 13:19:17 -07:00
medmunds
448d5ec8e5 Update Django and Python build versions
* Add Django 3.1 builds
* Django main is now 3.2dev; add test settings
* Rough in changelog deprecation notice for Django 1.11
  and Python 2.7
* Travis-CI is apparently supporting pypy3 alias now
* Travis-CI has apparently added Python 3.8 release now
2020-07-23 13:19:17 -07:00
medmunds
a68938bdc6 Docs: add shell quoting to install commands
In docs install examples, show double quotes around
package specifiers that include square brackets, to
prevent them from being interpreted as shell globs.
(Helps with installation on Windows and zsh, e.g.)

Closes #188
2020-07-22 13:43:07 -07:00
medmunds
35792354b3 Amazon SES: fix bcc
Set SendRawEmail Destinations param to pick up all
recipients, including bcc (which doesn't appear in
message headers).

Fixes #189
2020-07-22 13:42:48 -07:00
medmunds
c974c1ec67 Adjust to flake8's new opinions on import order 2020-07-22 13:42:48 -07:00
Dmitry Groshev
6792ed8658 Avoid Django3.0 force_text deprecation warning
Switch to force_str, falling back to deprecated 
force_text for Python 2 compatibility.
2020-06-06 11:19:59 -07:00
medmunds
7b3305d0b9 Release 7.1 2020-04-13 14:46:19 -07:00
medmunds
7a16b9e51f Docs: Update capitalization of "Sendinblue"
Sendinblue dropped the inner-cap ("SendinBlue")
from their brand sometime between September 2018
and March 2019. Update Anymail's docs to consistently
use the new spelling.

(But don't change any code, which has existing
string constants using the old spelling.)
2020-04-13 14:32:54 -07:00
jc-ee
2a36da54e6 Postmark: Fix sending templated email to a single recipient
Fix a bug where sending an email with a template_id and a single to address
would cause a Postmark API error.

Thanks @jc-ee for finding and fixing.
2020-04-13 13:48:37 -07:00
Mike Edmunds
920d8dd70f SendGrid: Fix multiple recipients with only merge_global_data
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
2020-03-18 17:08:10 -04:00
sebashwa
4245d468ec Docs: SendinBlue templates now support attachments
Attachments now work with SendinBlue templates as long as you are using their new template language (which Anymail has required since v7).

https://developers.sendinblue.com/changelog/send-attachment-with-template-through-apiv3

Existing code works. Just remove documentation that warned of their previous limitation.
2020-02-28 10:44:11 -08:00
Mike Edmunds
0c66e1eed9 Docs: document DEBUG_API_REQUESTS setting
(And add a system check to warn about its use in production deployment.)
2019-12-15 14:23:03 -08:00
Mike Edmunds
95080bfeb9 SendGrid: document text attachment charset bug
Document SendGrid's unpredictable behavior around forcing `charset="iso-8859-1"` into text attachments. (Since it seems to be happening again.)

See #150 for details.
2019-12-13 12:49:00 -08:00
Mike Edmunds
59685b82e1 Tests: work around Mailgun event reporting change
In the live integration tests, work around Mailgun's recent change
to how inline attachments are reported in "accepted" events data.

(But keep it working either way, since it seems likely this change was
unintentional—other event types still exclude inline attachments from
`event.message.attachments`.)

Fixes #172
2019-12-11 14:53:25 -08:00
medmunds
c38218dba1 Tests: Update for Django 3.0 release 2019-12-02 10:49:12 -08:00
A Lee
1fc44a4e15 Docs: fix typos and other minor text edits
- remove extraneous parens
- a few minor suggested text edits for readability
2019-10-15 14:40:17 -07:00
Mike Edmunds
acca6a46e1 Docs: Clarify that Postmark supports merge_data
Fix outdated info in ESP summary table.

Fixes #168.
2019-10-07 12:22:17 -07:00
medmunds
2ff088df71 Tests: fix Travis pypy versioning
One more try.
2019-09-27 18:21:36 -07:00
medmunds
484dd8b505 Tests: let Travis pick the specific pypy builds 2019-09-27 13:03:30 -07:00
medmunds
3167a74d35 Upgrade dev tooling
(Drop detox, which is built into tox 3.7 and later.)
2019-09-27 11:54:40 -07:00
medmunds
c6ab1e374c Tests: add Django 3.0 alpha, Python 3.8-dev 2019-09-27 10:58:35 -07:00
medmunds
2762ea9ff8 Docs: fix broken intersphinx mapping for requests
The requests docs may be moving, and redirects are currently broken.
Load the intersphinx inventory from a (currently) working temporary
location.
2019-09-26 19:25:20 -07:00
Mike Edmunds
0c37cd4b5f Release 7.0 2019-09-07 13:22:44 -07:00
Mike Edmunds
0a8887913c SendinBlue: additional template/tags improvements
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
2019-09-04 15:45:08 -07:00
Mike Edmunds
fd558e904e Mailgun: disable non-ASCII attachment filename workaround when not needed
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
2019-09-03 18:04:27 -07:00
Mike Edmunds
df29ee2da6 Mailgun: make merge_data work with stored handlebars templates
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.
2019-09-03 11:51:19 -07:00
medmunds
8143b76041 Sendinblue: remove attachment from template integration test
Newer send API doesn't allow attachments with templates.
See discussion in #158
2019-08-30 13:24:43 -07:00
Thorben Luepkes
989d56bd85 Sendinblue: use latest API improvements (templates, tags)
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
2019-08-28 18:52:11 -07:00
Ansel Santosa
73a73ea01f Mailgun: Support stored templates
Add support for Mailgun's new template option

Fixes #155
2019-07-30 10:50:42 -07:00