Usage

Add mails and addresses through the django admin.

In code

Fetch a mail-template:

template = Mail.objects.get(name='hello-world').

Fill it:

mail = template.make_message(
    sender='Yep <overridden-from@example.com'>,
    recipients=('extra1@example.com', u'Blåbærsyltetøy <extra2@example.com>'),
    context={'world': 'Mailrobot'}
)

Have a look:

print mail.message

Send it:

mail.send()

Niceties

In case you need to send an email somewhere else for testing/debugging, clone an existing email in the admin:

  1. Select it
  2. Choose “Clone selected mails” in the action list
  3. Hit “Go”

The clone will share everything with its original except the name, which will be suffixed with a timestamp.

Edit the name of the clone to what you need, change recipients, CCs, BCCs. Then, where you send the mail from, choose the clone if

Read the Docs v: v0.3
Versions
latest
v0.3
v0.2
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.