Skip to content

Commit

Permalink
Documentation - README.rst formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danifus committed Oct 16, 2015
1 parent ea845aa commit b108d22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/**<your_server_name>**), also found in your Mailgun
account details.

Expand All @@ -41,15 +41,15 @@ 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%', '[email protected]', [[email protected], [email protected]])
email.extra_headers['recipient_variables'] = '{"[email protected]":{"first_name":"Joe"}, "[email protected]":{"first_name":"Jane"}}'
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
-------------------------------------
Expand All @@ -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', '[email protected]', [[email protected]])
Expand Down

0 comments on commit b108d22

Please sign in to comment.