mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
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.
82 lines
2.1 KiB
ReStructuredText
82 lines
2.1 KiB
ReStructuredText
Installation
|
|
============
|
|
|
|
It's easiest to install Djrill from `PyPI <https://pypi.python.org/pypi/djrill>`_:
|
|
|
|
.. code-block:: console
|
|
|
|
$ pip install djrill
|
|
|
|
If you decide to install Djrill some other way, you'll also need to install its
|
|
one dependency (other than Django, of course): the `requests <http://docs.python-requests.org>`_
|
|
library from Kenneth Reitz.
|
|
|
|
|
|
Configuration
|
|
-------------
|
|
|
|
.. setting:: MANDRILL_API_KEY
|
|
|
|
In your project's :file:`settings.py`:
|
|
|
|
1. Add :mod:`djrill` to your :setting:`INSTALLED_APPS`::
|
|
|
|
INSTALLED_APPS = (
|
|
...
|
|
"djrill"
|
|
)
|
|
|
|
2. Add the following line, substituting your own :setting:`MANDRILL_API_KEY`::
|
|
|
|
MANDRILL_API_KEY = "brack3t-is-awesome"
|
|
|
|
3. Override your existing :setting:`EMAIL_BACKEND` with the following line::
|
|
|
|
EMAIL_BACKEND = "djrill.mail.backends.djrill.DjrillBackend"
|
|
|
|
|
|
Also, if you don't already have a :setting:`DEFAULT_FROM_EMAIL` in settings,
|
|
this is a good time to add one. (Django's default is "webmaster@localhost",
|
|
which won't work with Mandrill.)
|
|
|
|
|
|
Mandrill Webhooks (Optional)
|
|
----------------------------
|
|
|
|
Djrill includes optional support for Mandrill webhooks, including inbound email.
|
|
See the Djrill :ref:`webhooks <webhooks>` section for configuration details.
|
|
|
|
|
|
Other Optional Settings
|
|
-----------------------
|
|
|
|
.. setting:: MANDRILL_IGNORE_RECIPIENT_STATUS
|
|
|
|
MANDRILL_IGNORE_RECIPIENT_STATUS
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Set to ``True`` to disable :exc:`djrill.MandrillRecipientsRefused` exceptions
|
|
on invalid or rejected recipients. (Default ``False``.)
|
|
|
|
.. versionadded:: 2.0
|
|
|
|
|
|
.. setting:: MANDRILL_SUBACCOUNT
|
|
|
|
MANDRILL_SUBACCOUNT
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
If you are using Mandrill's `subaccounts`_ feature, you can globally set the
|
|
subaccount for all messages sent through Djrill::
|
|
|
|
MANDRILL_SUBACCOUNT = "client-347"
|
|
|
|
(You can also set or override the :attr:`subaccount` on each individual message,
|
|
with :ref:`Mandrill-specific sending options <mandrill-send-support>`.)
|
|
|
|
.. versionadded:: 1.0
|
|
MANDRILL_SUBACCOUNT global setting
|
|
|
|
|
|
.. _subaccounts: http://help.mandrill.com/entries/25523278-What-are-subaccounts-
|