Commit Graph

434 Commits

Author SHA1 Message Date
medmunds
701726c59d Fix SG integration tests 2016-03-11 16:28:46 -08:00
medmunds
e15cb46daf Implement SendGridBackend
Covers most of #1
2016-03-11 16:17:02 -08:00
medmunds
b407e9f452 Preserve filename of inline attachments
For ESPs that support both content-id and filename,
don't drop the filename.
2016-03-11 10:07:13 -08:00
medmunds
6214fbbdcd utils: add datetime-->timestamp conversion 2016-03-11 10:04:43 -08:00
medmunds
7a528af438 Include backend name in requests user-agent string 2016-03-11 10:01:29 -08:00
medmunds
3e3c97d6d3 Readme: missed a Djrill --> Anymail 2016-03-10 18:05:49 -08:00
medmunds
7920a4537c Docs: Clarify AnymailMessage not required 2016-03-10 16:57:26 -08:00
medmunds
1e1a66ae44 Bump to 0.1.dev1 2016-03-09 20:33:01 -08:00
medmunds
b6bbdf4791 The *package* name is "django-anymail"
(not just "anymail")
2016-03-09 20:27:44 -08:00
medmunds
c13ef4d5fa Travis does svg badges now
[ci skip]
2016-03-09 20:12:42 -08:00
medmunds
b4c60d55bd Travis: needs to install all the ESP extras 2016-03-09 19:37:18 -08:00
medmunds
6ef1349b65 GitHub doesn't like Sphinx directives in rst 2016-03-09 19:30:34 -08:00
medmunds
37a54cde3f Travis: disable older Django versions 2016-03-09 18:51:57 -08:00
medmunds
1e80c3ec37 Invert unsupported-features setting
Change from UNSUPPORTED_FEATURE_ERRORS
(default True) to IGNORE_UNSUPPORTED_FEATURES
(default False). Parallels IGNORE_RECIPIENT_STATUS.
2016-03-09 18:47:42 -08:00
medmunds
20c6350140 Update (almost) all the docs 2016-03-09 18:37:11 -08:00
medmunds
8f0f2d3d83 Use RTD Sphinx theme for local doc builds 2016-03-07 19:21:28 -08:00
medmunds
d1d41badc8 Add Mailgun backend 2016-03-07 18:07:48 -08:00
medmunds
4ad2af2469 Allow running specific test cases in runtests 2016-03-06 10:34:23 -08:00
medmunds
3a93648481 Normalize ESP response and recipient status 2016-03-05 17:22:27 -08:00
medmunds
518e6e86f8 Normalize text/html alternative handling in BasePayload 2016-03-05 15:16:49 -08:00
medmunds
a6c0eb5974 Normalize send_at date/datetime/timestamp in BasePayload.
Interpret dates and naive datetimes as Django's
current_timezone (rather than UTC like Djrill did).
This should be more likely to behave as expected
when running with a non-UTC TIME_ZONE setting.
2016-03-05 11:23:18 -08:00
medmunds
0a5bca1426 Make requests optional for backends that don't need it
(Prep for installing backends as package extras)

* Extract AnymailRequestsBackend and RequestsPayload
  to base_requests.py
* Don't define/require requests exceptions when requests
  not available
2016-03-04 17:39:43 -08:00
medmunds
38729df93c Uniform settings handling
For MANDRILL_API_KEY (e.g.,), look for these settings:
* ANYMAIL = { 'MANDRILL_API_KEY': '...' }
* ANYMAIL_MANDRILL_API_KEY = "..."
* MANDRILL_API_KEY = "..."

(the "bare" third version is used only for settings that
might be reasonably shared with other apps, like api keys)
2016-03-04 17:02:43 -08:00
medmunds
3b414a9619 Move all the payload construction into Payload classes 2016-03-04 15:55:19 -08:00
medmunds
dbf57d8a33 Move common message attrs into base backend 2016-03-03 16:52:10 -08:00
medmunds
ef971489cd Start factoring out common backend functionality 2016-02-29 11:52:35 -08:00
medmunds
1c7fe8a759 Rename exceptions
* Change Djrill -> Mandrill in exception names
* Don't re-export at package level
  (import from anymail.exceptions, not from anymail)
2016-02-27 12:03:45 -08:00
medmunds
921dd5d0d6 Fork from Djrill and rename to "anymail" 2016-02-27 11:16:04 -08:00
medmunds
f95d5d66dc Avoid weak ref to local signal receiver in webhook tests.
Webhook tests define a local signal receiver function,
so connect it using the `weak=False` option to set
a good example.

(This isn't technically needed in the tests: the test receivers
are only connected while their definitions are still in scope,
so they couldn't possibly be garbage collected. But it doesn't
hurt, and it's good practice in case the test code gets copied.)

Also update the webhook docs to have a direct link to
Django's "listening to signals" info.
2016-02-04 12:14:01 -08:00
medmunds
9c938c8e85 Fix webhook tests for pypy
(Disconnect signal receivers after
we're done with them, to avoid
confusion between test cases.)
2016-02-03 19:42:01 -08:00
medmunds
79eaac42c4 Handle Mandrill sync event webhooks
Fixes #108
2016-02-03 19:29:26 -08:00
medmunds
5d4440ef5d Open v2.1 development
[ci skip]
2015-12-02 20:06:32 -08:00
medmunds
48028ecf64 Switch back to python-approved versioning
2.0.0-dev0 --> 2.0.0.dev0 (or just 2.0.dev0)

We still practice semver in the major.minor.patch
versions; we just don't use semver's "-" for
pre-release versions. (Because, PEP 0440.)

https://www.python.org/dev/peps/pep-0440/
2015-12-02 19:50:28 -08:00
Mike Edmunds
68929e015e Merge pull request #105 from brack3t/v2.0-dev
Move master to v2.0
2015-12-02 18:51:01 -08:00
medmunds
ed77987552 Docs: couple more release notes 2015-12-02 18:39:08 -08:00
medmunds
7706a5d39f Docs: 2.0 upgrade guide, release notes 2015-12-02 18:25:26 -08:00
medmunds
c625b6f12f Add .editorconfig and CONTRIBUTING.md 2015-12-02 17:22:02 -08:00
medmunds
d496555813 Docs: remove pre-2.0 versionadded/versionchanged
(Cut the old-version clutter)
2015-12-02 17:06:15 -08:00
medmunds
265c7460e0 Support Django 1.9 release 2015-12-02 16:59:34 -08:00
medmunds
02641b0959 Improve send_at docs
* Try to clear up timezones
* Note requirement for funded account
2015-12-02 16:52:42 -08:00
medmunds
d82d425aa8 Clean up mandrill_reponse docs
Document mandrill_response as an attribute
(not just a generic topic).
2015-12-02 16:18:57 -08:00
medmunds
9971c1780f Document MANDRILL_API_URL 2015-12-02 16:10:29 -08:00
medmunds
aa46fadb48 Clean up global MANDRILL_SETTINGS
* Clean up Djrill backend __init__
* Fold MANDRILL_SUBACCOUNT into
  global_settings logic
* Add some missing override tests
* Update docs
2015-12-02 15:58:23 -08:00
medmunds
5c39e40ea1 Use urljoin to build api endpoint
(String arithmetic was probably OK
for our limited use case, but in general
is a bad idea for constructing urls.)
2015-12-02 14:21:53 -08:00
medmunds
fe1e2d1ae5 Refactor backend
* Break apart massive _send call
* Try to facilitate subclassing
* Centralize fail_silently handling during _send
* Include original EmailMessage as exception attr
2015-12-02 12:41:26 -08:00
medmunds
b8cdc6ce82 Cleanup Djrill exceptions
* Add common base DjrillException

* Simplify backend by moving logic
  to describe errors into base DjrillException

* Add NotSerializableForMandrillError
  for JSON serialization errors
2015-12-02 10:52:20 -08:00
medmunds
221530ae11 Fix tests on python 3 2015-12-01 13:57:45 -08:00
medmunds
d14b87c910 Raise error for invalid/rejected recipients
Raise new MandrillRecipientsRefused exception
when Mandrill returns 'reject' or 'invalid' status
for *all* recipients of a message.

(Similar to Django's SMTP email backend raising
SMTPRecipientsRefused.)

Add setting MANDRILL_IGNORE_RECIPIENT_STATUS
to override the new exception.

Trap JSON parsing errors in Mandrill API response,
and raise MandrillAPIError for them. (Helps with #93.)

Closes #80.
Closes #81.
2015-12-01 13:26:21 -08:00
medmunds
8433e6d660 Clean up all imports
* Use relative imports within djrill package
* Standardize ordering
* Remove absolute_import (it's standard in all
  python versions we now support)
2015-11-30 17:33:08 -08:00
medmunds
632334b426 Don't access MANDRILL_API_URL setting at module level
Move MANDRILL_API_URL setting lookup into Djrill
backend init (where it's used).

Because "modules should not in general use settings
stored in django.conf.settings at the top level".
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/#use-of-django-conf-settings
2015-11-30 17:20:27 -08:00