Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Stores and sends canned email responses.

Project Description

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.

Depends on Django, with a version between 1.8 and 1.10, inclusive.


  1. Install the library, for instance with pip:

    pip install django-mailrobot
  2. Add the library to your INSTALLED_APPS of an exiting project:

    INSTALLED_APPS += ['mailrobot']
  3. Add the tables to the existing project.

    Prior to django 1.7:

    $ ./ syncdb

    With South:

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


Copy the entire django-mailrobot directory somewhere, set up and enter a virtualenv, then provided you are on some Un*x:

make demo

This’ll ask you to make an admin user. Do so.

The demo should now be running on


To run the tests, first install the testing-requirements:

pip install -r requirements/test.txt

then run the tests with:

make test APP=mailrobot


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 <'>,
    recipients=('', u'Blåbærsyltetøy <>'),
    context={'world': 'Mailrobot'}

Have a look:

print mail.message

Send it:



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 settings.DEBUG is True.


Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(8.8 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Sep 13, 2016
(6.2 kB) Copy SHA256 Hash SHA256
Source None Sep 13, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting