From ea845aa4267ba4a8e8f7f8da00a86b546f8cc72c Mon Sep 17 00:00:00 2001 From: Daniel Hillier Date: Fri, 16 Oct 2015 15:46:51 +1100 Subject: [PATCH 1/2] Documentation - Add where to find Mailgun parameters --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index b3be298..49a678b 100644 --- a/README.rst +++ b/README.rst @@ -21,6 +21,11 @@ Add the following to your settings.py:: MAILGUN_ACCESS_KEY = 'ACCESS-KEY' MAILGUN_SERVER_NAME = 'SERVER-NAME' +Replace ``ACCESS-KEY`` with the ``API-KEY`` value from your Mailgun account details and +``SERVER-NAME`` with the last part of your ``API Base URL`` +(eg. https://api.mailgun.net/v3/****), also found in your Mailgun +account details. + Now, when you use ``django.core.mail.send_mail``, Mailgun will send the messages. .. _Builtin Email Error Reporting: http://docs.djangoproject.com/en/1.2/howto/error-reporting/ From b108d2226e567acc9e6ceea7613d6b3c2834680e Mon Sep 17 00:00:00 2001 From: Daniel Hillier Date: Fri, 16 Oct 2015 16:04:04 +1100 Subject: [PATCH 2/2] Documentation - README.rst formatting fixes --- README.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 49a678b..729cc32 100644 --- a/README.rst +++ b/README.rst @@ -15,14 +15,14 @@ Install django-mailgun:: pip install django-mailgun -Add the following to your settings.py:: +Add the following to your ``settings.py``:: EMAIL_BACKEND = 'django_mailgun.MailgunBackend' MAILGUN_ACCESS_KEY = 'ACCESS-KEY' MAILGUN_SERVER_NAME = 'SERVER-NAME' -Replace ``ACCESS-KEY`` with the ``API-KEY`` value from your Mailgun account details and -``SERVER-NAME`` with the last part of your ``API Base URL`` +Replace ``ACCESS-KEY`` with the "API-KEY" value from your Mailgun account details and +``SERVER-NAME`` with the last part of your "API Base URL" (eg. https://api.mailgun.net/v3/****), also found in your Mailgun account details. @@ -41,7 +41,7 @@ Passing user-specific data Mailgun also includes the ability to send emails to a group of recipients via a single API call (https://documentation.mailgun.com/user_manual.html#batch-sending). To make use of this, you need to pass Recipient Variables along with your API call. To do so with Django-Mailgun, -add a valid json string to the `extra_headers` attribute of EmailMessage and Django-Mailgun will +add a valid JSON string to the ``extra_headers`` attribute of ``EmailMessage`` and Django-Mailgun will remove the string from the headers and send it appropriately. For example:: email = EmailMessage('Hi!', 'Cool message for %recipient.first_name%', 'admin@example.com', [joe@example.com, jane@example.com]) @@ -49,7 +49,7 @@ remove the string from the headers and send it appropriately. For example:: email.send() When Jane receives her email, its body should read 'Cool message for Jane', and Joe will see -'Cool messagae for Joe'. +'Cool message for Joe'. Analytics and other tracking features ------------------------------------- @@ -58,7 +58,7 @@ Mailgun provides the ability to track certain events that concern your emails. T API exposes these options (see https://documentation.mailgun.com/api-sending.html#sending). These options can also be passed to Mailgun's SMTP server (see "Passing Sending Options" under https://documentation.mailgun.com/user_manual.html#sending-via-smtp). If you add -any of the SMTP options to the `extra_headers` attribute of EmailMessage, Django-Mailgun +any of the SMTP options to the ``extra_headers`` attribute of ``EmailMessage``, Django-Mailgun will map those values over to the appropriate API parameter. For example:: email = EmailMessage('Hi!', 'Cool message for Joe', 'admin@example.com', [joe@example.com])