Skip to main content

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.

Installation

  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.

    $ ./manage.py migrate

Demo

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 create a demo-user “demo” with the password “demo”.

The demo should now be running on http://127.0.0.1/

Tests

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

pip install -r requirements/test.txt

then run the tests with:

make test APP=mailrobot

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

Version:

0.5.3

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.5.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_mailrobot-0.5.3-py2.py3-none-any.whl (14.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: django-mailrobot-0.5.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

File hashes

Hashes for django-mailrobot-0.5.3.tar.gz
Algorithm Hash digest
SHA256 558ee3bf2ad1459f36fb7c990884ecd07da2462ce7ccd6d446b533e7df4320db
MD5 a52f83863ffcf31e1a054d3fd0638694
BLAKE2b-256 6ccbee0702052d6276c08467810899586eb48b4bbd91aecfb185da1c1a1c6872

See more details on using hashes here.

File details

Details for the file django_mailrobot-0.5.3-py2.py3-none-any.whl.

File metadata

  • Download URL: django_mailrobot-0.5.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

File hashes

Hashes for django_mailrobot-0.5.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 01540a331e9d616dbdfd94bb14bff39a5c90d05a66fa1587f04d06762ad1aa6a
MD5 d2ef68e524e5175df33776f95c96c218
BLAKE2b-256 c2a1ceb7a300163667ab6224adb769dad2b7c3954422e12345a49a5c20006d00

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