Version 0.2.0

* Release notes in readme
* Update example in readme
* Note deprecation of DjrillMessage class
* Longer long_description for PyPI
* Update authors
* Bump version number (setup.py and __init__.py)
This commit is contained in:
medmunds
2012-12-11 13:19:21 -08:00
parent 2a2ca6c137
commit bc9e6212a6
5 changed files with 59 additions and 23 deletions

View File

@@ -6,3 +6,5 @@ Chris Jones
Mike Edmunds Mike Edmunds
ArnaudF ArnaudF
Théo Crevon Théo Crevon
Rafael E. Belliard
Jared Morse

View File

@@ -4,13 +4,13 @@ Djrill, for Mandrill
.. image:: https://secure.travis-ci.org/brack3t/Djrill.png?branch=master .. image:: https://secure.travis-ci.org/brack3t/Djrill.png?branch=master
:target: https://travis-ci.org/brack3t/Djrill :target: https://travis-ci.org/brack3t/Djrill
Djrill is an email backend and new message class for Django users that want to take advantage of the Mandrill_ transactional Djrill is an email backend for Django users who want to take advantage of the
email service from MailChimp_. Mandrill_ transactional email service from MailChimp_.
An optional Django admin interface is included. The admin interface allows you to: An optional Django admin interface is included. The admin interface allows you to:
* Check the status of your Mandrill API connection. * Check the status of your Mandrill API connection.
* See stats on email tags and urls. * See stats on email senders, tags and urls.
Djrill is made available under the BSD license. Djrill is made available under the BSD license.
@@ -81,35 +81,38 @@ package, including ``send_mail``, ``send_mass_mail``, ``EmailMessage`` and
``EmailMultiAlternatives``. ``EmailMultiAlternatives``.
You can also take advantage of Mandrill-specific features like tags, metadata, You can also take advantage of Mandrill-specific features like tags, metadata,
and tracking by creating a ``django.mail.EmailMessage`` (or for HTML, and tracking by creating a Django EmailMessage_ (or for HTML,
``django.mail.EmailMultiAlternatives``) object and setting Mandrill-specific EmailMultiAlternatives_) object and setting Mandrill-specific
properties on it before calling its ``send`` method. properties on it before calling its ``send`` method.
Example: Example, sending HTML email with Mandrill tags and metadata:
.. code:: python .. code:: python
from django.core.mail import EmailMultiAlternatives # or just EmailMessage if you don't need HTML from django.core.mail import EmailMultiAlternatives
subject = "Djrill Message" msg = EmailMultiAlternatives(
from_email = "Djrill Sender <djrill@example.com>" # this has to be in your Mandrill account's sending domains subject="Djrill Message",
to = ["Djrill Receiver <djrill.receiver@example.com>", "djrill.two@example.com"] body="This is the text version of your email",
reply_email = "Customer Service <support@example.com>" # optional from_email="Djrill Sender <djrill@example.com>",
text_content = "This is the text version of your email" to=["Djrill Receiver <djrill.receiver@example.com>", "another.person@example.com"],
html_content = "<p>This is the HTML version of your email</p>" # optional, use with ``attach_alternative`` below headers={'Reply-To': "Service <support@example.com>"} # optional extra headers
)
msg.attach_alternative("<p>This is the HTML version of your email</p>", "text/html")
msg = EmailMultiAlternatives(subject, text_content, from_email, to, headers={'Reply-To': reply_email}) # Optional Mandrill-specific extensions (see full list below):
msg.tags = ["one tag", "two tag", "red tag", "blue tag"] # optional, Mandrill-specific message extension msg.tags = ["one tag", "two tag", "red tag", "blue tag"]
msg.metadata = {'user_id': "8675309"} # optional, Mandrill-specific message extension msg.metadata = {'user_id': "8675309"}
msg.attach_alternative(html_content, "text/html")
# Send it:
msg.send() msg.send()
If the Mandrill API returns an error response for any reason, the send call will If the Mandrill API returns an error response for any reason, the send call will
raise a ``djrill.mail.backends.djrill.DjrillBackendHTTPError`` exception raise a ``djrill.mail.backends.djrill.DjrillBackendHTTPError`` exception
(unless called with fail_silently=True). (unless called with fail_silently=True).
Djrill supports most of the functionality of Django's ``EmailMessage`` and Djrill supports most of the functionality of Django's `EmailMessage`_ and
``EmailMultiAlternatives``. Some limitations: `EmailMultiAlternatives`_ classes. Some limitations:
* Djrill accepts additional headers, but only ``Reply-To`` and ``X-*`` (since * Djrill accepts additional headers, but only ``Reply-To`` and ``X-*`` (since
that is all that Mandrill accepts). Any other extra headers will raise a that is all that Mandrill accepts). Any other extra headers will raise a
@@ -125,6 +128,10 @@ Djrill supports most of the functionality of Django's ``EmailMessage`` and
which Djrill doesn't use. *Caution:* depending on the ``preserve_recipients`` which Djrill doesn't use. *Caution:* depending on the ``preserve_recipients``
setting, this could result in exposing bcc addresses to all recipients. It's setting, this could result in exposing bcc addresses to all recipients. It's
probably best to just avoid bcc.) probably best to just avoid bcc.)
* All email addresses (from, to, cc) can be simple ("email@example.com") or
can include a display name ("Real Name <email@example.com>").
* The ``from_email`` must be in one of the approved sending domains in your
Mandrill account.
Many of the options from the Mandrill `messages/send.json API`_ ``message`` Many of the options from the Mandrill `messages/send.json API`_ ``message``
struct can be set directly on an ``EmailMessage`` (or subclass) object: struct can be set directly on an ``EmailMessage`` (or subclass) object:
@@ -160,7 +167,8 @@ see ``DjrillMandrillFeatureTests`` in tests.py for examples.
Testing Testing
------- -------
Djrill is tested against Django 1.3 and 1.4 on Python 2.6 and 2.7. Djrill is tested against Django 1.3 and 1.4 on Python 2.6 and 2.7, and
Django 1.5beta on Python 2.7.
(It may also work with Django 1.2 and Python 2.5, if you use an older (It may also work with Django 1.2 and Python 2.5, if you use an older
version of requests compatible with that code.) version of requests compatible with that code.)
@@ -179,6 +187,18 @@ or::
python runtests.py python runtests.py
Release Notes
-------------
Version 0.2.0:
* ``MANDRILL_API_URL`` is no longer required in settings.py
* Earlier versions of Djrill required use of a ``DjrillMessage`` class to
specify Mandrill-specific options. This is no longer needed -- Mandrill
options can now be set directly on a Django EmailMessage_ object or any
subclass. (Existing code can continue to use ``DjrillMessage``.)
Thanks Thanks
------ ------
@@ -193,5 +213,7 @@ the awesome ``requests`` library.
.. _django-adminplus: https://github.com/jsocol/django-adminplus .. _django-adminplus: https://github.com/jsocol/django-adminplus
.. _mock: http://www.voidspace.org.uk/python/mock/index.html .. _mock: http://www.voidspace.org.uk/python/mock/index.html
.. _django.core.mail: https://docs.djangoproject.com/en/dev/topics/email/ .. _django.core.mail: https://docs.djangoproject.com/en/dev/topics/email/
.. _EmailMessage: https://docs.djangoproject.com/en/dev/topics/email/#django.core.mail.EmailMessage
.. _EmailMultiAlternatives: https://docs.djangoproject.com/en/dev/topics/email/#sending-alternative-content-types
.. _messages/send.json API: https://mandrillapp.com/api/docs/messages.html#method=send .. _messages/send.json API: https://mandrillapp.com/api/docs/messages.html#method=send

View File

@@ -1,7 +1,7 @@
from django.contrib.admin.sites import AdminSite from django.contrib.admin.sites import AdminSite
from django.utils.text import capfirst from django.utils.text import capfirst
VERSION = (0, 1, 2) VERSION = (0, 2, 0)
__version__ = '.'.join([str(x) for x in VERSION]) __version__ = '.'.join([str(x) for x in VERSION])

View File

@@ -1,6 +1,9 @@
from django.core.mail import EmailMultiAlternatives from django.core.mail import EmailMultiAlternatives
# DjrillMessage class is deprecated as of 0.2.0, but retained for
# compatibility with existing code. (New code can just set Mandrill-specific
# options directly on an EmailMessage or EmailMultiAlternatives object.)
class DjrillMessage(EmailMultiAlternatives): class DjrillMessage(EmailMultiAlternatives):
alternative_subtype = "mandrill" alternative_subtype = "mandrill"

View File

@@ -2,9 +2,8 @@ from setuptools import setup
setup( setup(
name="djrill", name="djrill",
version="0.1.4.1", version="0.2.0",
description='Django email backend for Mandrill.', description='Django email backend for Mandrill.',
long_description='Email backend and new message class to send emails through the Mandrill email service.',
keywords="django, mailchimp, mandrill, email, email backend", keywords="django, mailchimp, mandrill, email, email backend",
author="Kenneth Love <kenneth@brack3t.com>, Chris Jones <chris@brack3t.com>", author="Kenneth Love <kenneth@brack3t.com>, Chris Jones <chris@brack3t.com>",
author_email="kenneth@brack3t.com", author_email="kenneth@brack3t.com",
@@ -23,4 +22,14 @@ setup(
"Framework :: Django", "Framework :: Django",
"Environment :: Web Environment", "Environment :: Web Environment",
], ],
long_description="""\
Djrill is an email backend for Django users who want to take advantage of the
`Mandrill <http://mandrill.com>`_ transactional email service from MailChimp.
In general, Djrill "just works" with Django's built-in ``django.core.mail``
package. You can also take advantage of Mandrill-specific features like tags,
metadata, and tracking. An optional Django admin interface is included.
Full details are on the `project page <https://github.com/brack3t/Djrill>`_.
""",
) )