Commit Graph

668 Commits

Author SHA1 Message Date
medmunds
0a95f1346a Docs: add info on handling transient ESP errors
Closes #55
2017-09-08 14:27:49 -07:00
medmunds
b6c75fe06b Docs: update intersphinx refs from Python 3.5 to 3.6 2017-09-08 14:19:43 -07:00
medmunds
90b9dc6cfa Docs: simplify PyPI links
Use `:pypi:` sphinx-ext-extlink role for links to PyPI,
and add some missing package links.
2017-09-08 14:16:09 -07:00
medmunds
2faa5f96cb Clean up and document Anymail's test EmailBackend
* Change Anymail's test EmailBackend to collect sent messages in
  django.core.mail.outbox, same as Django's own locmem EmailBackend.
  (So Django's test runner will automatically clear accumulated mail
  between test cases.)

* Rename EmailMessage `test_response` attr to `anymail_test_response`
  to avoid conflicts, and record merged ESP send params in
  new `anymail_send_params` attr.

* Add docs

Closes #36.
2017-09-01 13:13:25 -07:00
Jonas Haag
a9c663f36a Docs: Add more mail template apps (#72) 2017-08-29 12:07:34 -07:00
medmunds
3809d3d2e2 Mailjet: correct settings docs
`MAILJET_SECRET_KEY` not `MAILJET_API_SECRET`.
(Heading was correct; text and example were wrong.)

Fixes #71
2017-07-24 11:13:59 -07:00
medmunds
6ddfe8e5d6 Add GitHub issue template 2017-07-13 17:02:08 -07:00
medmunds
872b67ee57 Open development for 0.12 2017-07-13 16:43:14 -07:00
medmunds
60a6c968f2 setup: flake clean 2017-07-13 16:30:40 -07:00
medmunds
7c6072afc9 Release 0.11 2017-07-13 16:28:21 -07:00
medmunds
516312bf00 Docs: note auth header must be passed through WSGI for webhooks
(See #69.)
2017-07-13 16:05:54 -07:00
medmunds
beec6e876a Mailjet: include in setup.py 2017-07-13 15:45:02 -07:00
medmunds
54d2fe2513 Mailjet: add docs 2017-07-13 15:43:11 -07:00
medmunds
d6d8044066 Mailjet: support tracking webhooks 2017-07-13 11:27:00 -07:00
medmunds
fc59707133 Webhooks: default tracking event tags=[], metadata={}
If a tracking event doesn't contain tags or metadata, set the event
record fields to tags=[] or metadata={} to simplify checking values.

Closes #67
2017-06-30 16:56:36 -07:00
Peter Wu
e39614e5a5 Mailjet backend support (#66)
Add Mailjet backend. (Docs and webhooks to follow.)

Thanks to @Lekensteyn and @calvin.
2017-06-30 16:33:53 -07:00
medmunds
1cc357836f Open development for 0.11 2017-05-22 12:09:19 -07:00
medmunds
6cc7ba38b0 Release 0.10 2017-05-22 11:49:30 -07:00
medmunds
0b50f278b5 Docs: add contact email for security issues 2017-05-22 11:46:37 -07:00
medmunds
67b9d8361d Include SparkPost in PyPI short description 2017-05-22 11:39:02 -07:00
medmunds
ba6ccdb13a Mailgun: handle x.y.z status code in webhooks
Mailgun sometimes (though not usually) gives the 'code' event
field as an RFC-3463 extended SMTP status code. Handle either
format.

Fixes #62
2017-05-22 11:09:26 -07:00
medmunds
bb54806dcf Tests: update settings for Django 1.11 final
Regenerate test settings.py using released Django 1.11.
(Had version from alpha Django 1.11a1. Only comments changed.)
2017-04-19 12:49:02 -07:00
medmunds
6b6793016e Mailgun, SparkPost: support multiple from_email addresses
[RFC-5322 allows](https://tools.ietf.org/html/rfc5322#section-3.6.2)
multiple addresses in the From header.

Django's SMTP backend supports this, as a single comma-separated
string (*not* a list of strings like the recipient params):

    from_email='one@example.com, two@example.com'
    to=['one@example.com', 'two@example.com']

Both Mailgun and SparkPost support multiple From addresses
(and Postmark accepts them, though truncates to the first one
on their end). For compatibility with Django -- and because
Anymail attempts to support all ESP features -- Anymail now
allows multiple From addresses, too, for ESPs that support it.

Note: as a practical matter, deliverability with multiple
From addresses is pretty bad. (Google outright rejects them.)

This change also reworks Anymail's internal ParsedEmail object,
and approach to parsing addresses, for better consistency with
Django's SMTP backend and improved error messaging.

In particular, Django (and now Anymail) allows multiple email
addresses in a single recipient string:

    to=['one@example.com', 'two@example.com, three@example.com']
    len(to) == 2  # but there will be three recipients

Fixes #60
2017-04-19 12:43:33 -07:00
medmunds
3c2c0b3a9d Travis: move live tests from pypy to py3
Fix incorrect change from Django 1.11 release.
Intent is to run live tests on newest released Django
under Python 3, and on oldest supported Django under
Python 2.7. (Though they should -- and do -- pass under
pypy. Just trying to conserve ESP testing credits.)
2017-04-16 15:24:18 -07:00
medmunds
db43af366e Add flake8 Travis-CI jobs
(Using bash env tests like this is a little ugly;
in the future, should just switch to tox.)
2017-04-16 12:40:05 -07:00
medmunds
8bdc67939a Flake8 clean 2017-04-16 11:43:13 -07:00
medmunds
853a7cd31d Cleanup forwarded email attachment test
... prep for flake8
2017-04-15 12:46:19 -07:00
Luke Plant
7d7448011b Fixed crasher when sending rfc822 messages as attachments. (#59) 2017-04-15 11:45:32 -07:00
medmunds
7b010ab224 Open development for 0.10 2017-04-04 12:18:24 -07:00
medmunds
ac94aa5b27 Release 0.9 2017-04-04 12:11:07 -07:00
medmunds
09bec9e463 Improve error when reply_to isn't list.
Issue a better error message if message.reply_to
is set to a single string.

(Would also like to do this for to, cc, and bcc,
but Django core EmailMessage.recipients is called
and stumbles over thoses cases before Anymail's
backend gets involved.)

Fixes #57
2017-04-04 11:57:11 -07:00
medmunds
3dd05ae882 Mailgun: update integration tests
Track change to Mailgun's events API, which
no longer includes message recipients.

(Only affected check for successful send
in the integration tests; Anymail doesn't
use the events API outside test code.)

Fixes #58
2017-04-04 10:33:03 -07:00
medmunds
cbd1666d98 Support released (not pre) Django 1.11 2017-04-04 10:20:56 -07:00
medmunds
23bbc3284f **Mandrill, Postmark:** Normalize soft-bounce webhook
events to event_type 'bounced' (rather than 'deferred').

Fixes #56
2017-03-16 15:36:06 -07:00
medmunds
68c7f6ccf3 Open development for 0.9 2017-02-01 16:09:10 -08:00
medmunds
eb3ce34d26 Release 0.8 2017-02-01 15:55:55 -08:00
medmunds
e0cca8c3ed Docs: update Mandrill webhook instructions
* Mandrill now refers to "whitelist change" events
  (used to be "whitelist sync").
* More details on solving validation failures due to
  webhook url mismatches.
2017-02-01 14:42:07 -08:00
medmunds
966511474c Docs: show "unreleased" warning on latest version
Fixes #52
2017-01-26 13:55:53 -08:00
medmunds
9e641169e3 Docs: update readme and index
* Remove readme link to unreleased dev docs
* Match pre-1.0 disclaimer in docs index
  to earlier update in readme
2017-01-26 12:09:53 -08:00
medmunds
bcd0350295 Readme: fix external docs/build links
* The default (GitHub) readme should point
  to the stable docs version, rather than
  the latest development version.
* The frozen links in PyPI should use the full
  patch version number (X.Y.Z), not just the minor
  X.Y version. (Leftover from Djrill's branch-based
  version management; Anymail uses tags
  for versions, and old way was creating incorrect
  frozen doc links for patch releases.)
2017-01-26 11:48:43 -08:00
medmunds
1e09b61a27 Docs: remove old copyright year 2017-01-26 11:43:28 -08:00
medmunds
0973618623 Docs: update readme
* "early development" --> "pre-1.0"
* Add Django 1.11 support

[ci skip]
2017-01-22 11:49:46 -08:00
medmunds
23800657b8 Support Python 3.6 with Django 1.11-alpha
Only real problem is in json serialization tests:
Python 3.6 [changed][1] the json serialization
error message to use the object's class name
rather than its repr. E.g.:
  "Decimal('19.99') is not JSON serializable"
becomes:
  "Object of type 'Decimal' is not JSON serializable"

Update tests that looked for specific serialization
error message to just look for the word "Decimal"
instead. (Works with all Python versions.)

[1]: https://bugs.python.org/issue26623
2017-01-22 11:34:57 -08:00
medmunds
33fdd0fb49 Docs: update multiple backend example
get_connection kwargs example was no longer
valid with switch to SendGrid v3 API.
2017-01-22 10:35:56 -08:00
medmunds
56d2b53c2b Use specific ESP name in error messages.
Change  (e.g.,) "ESP API response 400"
to "Mailgun API response 400".
2017-01-22 10:21:19 -08:00
medmunds
79288603fb Rename EmailBackends for Django consistency
* **Future breaking change:**
  Rename all Anymail backends to just `EmailBackend`,
  matching Django's naming convention.
  (E.g., switch to "anymail.backends.mailgun.EmailBackend"
  rather than "anymail.backends.mailgun.MailgunBackend".)

  The old names still work, but will issue a DeprecationWarning
  and will be removed in some future release.

  (Apologies for this change; the old naming convention was
  a holdover from Djrill, and I wanted consistency with
  other Django EmailBackends before hitting 1.0.)

Fixes #49.
2017-01-20 15:47:37 -08:00
medmunds
bff01b440a Fix webhook tests for Django 1.11-alpha
Django 1.11 appears to enforce ALLOWED_HOSTS
(more strictly) during tests.
2017-01-19 19:22:16 -08:00
medmunds
0ba5d1d4ad Mandrill: include auth in webhook signature calc
Mandrill's webhook signature calculation uses the
*exact url* Mandrill is posting to. If HTTP basic
auth is also used, that auth is included in the url.

Anymail was using Django's request.build_absolute_uri,
which doesn't include HTTP basic auth. Anymail now
includes the auth in the calculation, if it was present
in the request.

This should eliminate the need to use the
ANYMAIL_MANDRILL_WEBHOOK_URL override,
if Django's SECURE_PROXY_SSL_HEADER and
USE_X_FORWARDED_HOST (and/or
USE_X_FORWARDED_PROTO) settings are correct
for your server.

(The calculated url is now also included in
the validation failure error message, to aid
debugging.)

Fixes #48
2017-01-19 19:01:36 -08:00
medmunds
12660d3d4f Tests: fix .travis.yml for Django 1.11a 2017-01-19 15:13:41 -08:00
medmunds
0eab2172d2 Tests: add Django 1.11-alpha
(including on Python 3.6)

Allow failures on prerelease Django tests.
2017-01-19 14:54:59 -08:00