Commit Graph

808 Commits

Author SHA1 Message Date
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
medmunds
df3d577b41 Release 6.1 2019-07-07 16:20:22 -07:00
medmunds
181d5886eb Add MAILGUN_WEBHOOK_SIGNING_KEY setting.
Fixes #153.
2019-07-07 13:43:08 -07:00
medmunds
fe6ee5bf84 Release 6.0.1 2019-05-19 11:30:28 -07:00
medmunds
5dce0895f1 Fix UnicodeEncodeError error while reporting invalid email address.
Fixes #148.
2019-05-19 11:19:21 -07:00
medmunds
44518ed69f Update tests, CI, readme for Django 2.2 release.
(Earlier Anymail releases work fine with Django 2.2, and have been
tested against it; this just makes everything official.)

Prefer Python 3.7 and Django 2.2 for "extra" tests (live integration,
optional packages, Django master).
2019-05-08 13:29:56 -07:00
medmunds
ebb6b041e7 Support using AnymailMessage with django-mailer
Make UNSET preserve its identity across pickling. (Also make its repr
mention "unset", to simplify interpretting stack traces.)

Fixes #147.
2019-05-08 13:16:01 -07:00
medmunds
4c443f5515 Release 6.0 2019-02-23 16:28:15 -08:00
medmunds
dabbdad3bd Properly encode path components used to construct API URLs
Resolves #144 and similar potential issues
2019-02-23 15:27:41 -08:00
medmunds
578bad9a57 SendGrid: generate unique message_id for each batch recipient
Closes #139
2019-02-23 15:01:54 -08:00
medmunds
d2d568b6d3 SendGrid: simplify personalizations processing; stop using "sections"
* Rework and simplify personalizations code (that had grown convoluted
  through several feature additions).

* Stop putting merge_global_data in legacy template "sections"; instead
  just merge it into individual personalization substitutions like we
  do for dynamic templates. (The "sections" version didn't add any
  functionality, had the potential for conflicts with the user's own
  template section tags, and was needlessly complex.)
2019-02-23 14:07:01 -08:00
medmunds
f89d92bc37 Tests: avoid pummeling httpbin.org
Tag RequestsBackendLiveTestCase as 'live' so it only runs in a couple
of Travis builds (rather than all 20+ of them).
2019-02-23 13:49:00 -08:00
Mike Edmunds
75d7671056 Add merge_metadata for other ESPs
Support merge_metadata in Mailgun, Mailjet, Mandrill, Postmark, 
SparkPost, and Test backends. (SendGrid covered in earlier PR.)

Also:
* Add `merge_metadata` to AnymailMessage, AnymailMessageMixin
* Add `is_batch()` logic to BasePayload, for consistent handling
* Docs

Note: Mailjet implementation switches *all* batch sending from their 
"Recipients" field to to the "Messages" array bulk sending option.
This allows an independent payload for each batch recipient.
In addition to supporting merge_metadata, this also removes the
prior limitation on mixing Cc/Bcc with merge_data.

Closes #141.
2019-02-23 13:32:28 -08:00