Skip to main content

Stores and sends canned email responses.

Project description

================
django-mailrobot
================

Stores and sends canned email responses.

Ever had to change the signature or add a recipient to N hardcoded emails
spread all throughout your code? Hardcode no more! Use mailrobot instead.

Installation
============

Install library, for instance with pip:

pip install django-mailrobot

Add library to your INSTALLED_APPS in your settings:

INSTALLED_APPS += ['mailrobot']

Add the tables.

Prior to django 1.7:

$ ./manage.py syncdb

After django 1.7:

$ ./manage.py migrate mailrobot

With South:

$ ./manage.py schemamigration --initial mailrobot
$ ./manage.py migrate mailrobot

Usage
=====

Add mails and addresses through the django admin.

Fetch a mail-template:

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

Fill it:

mail = template.make_template(
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: Select
it, choose "Clone selected mails" in the action list, 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
settings.DEBUG is True.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-mailrobot-0.1.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file django-mailrobot-0.1.tar.gz.

File metadata

File hashes

Hashes for django-mailrobot-0.1.tar.gz
Algorithm Hash digest
SHA256 c542127e43c95e261ac7d67ae00d0b308e82987e1f2f420bf90d6bd63bb69949
MD5 88eafc772ca22490bcf68f192ddebb4a
BLAKE2b-256 13c0923082a145b0626e1f4a4501c45bacf7acb885d8851c9b7d13a9a1046f75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page