ievv_developemail — Develop mail backend that lets you view mails in django admin


Add it to INSTALLED_APPS setting, and set the EMAIL_BACKEND setting (typically only in develop settings):

    # ...

EMAIL_BACKEND = 'ievv_opensource.ievv_developemail.email_backend.DevelopEmailBackend'


$ python migrate

You should now get new emails both logged to the terminal, and added as a DevelopEmail object in the database which you can browse in Django admin.

How it works

We have a custom email backend that sends emails to the DevelopEmail database model (and to log).

Management script for sending test emails

We provide the ievv_developemail_send_testmail management script for sending test emails. It can be useful just to check that emails are sent, but also for testing cradmin_email styling etc.

In its simplest form:

$ python ievv_developemail_send_testmail --to ""

The same, but with an HTML message:

$ python ievv_developemail_send_testmail --to "" --html

With a custom message instead of the default lorem ipsum message:

$ python ievv_developemail_send_testmail --to "" --html --message-html "Dette er <em>en test lizzm</em>"

Send using django_cradmin.apps.cradmin_email.emailutils.AbstractEmail:

$ python ievv_developemail_send_testmail --to "" --html --use-cradmin-email
.. or with custom message ..
$ python ievv_developemail_send_testmail --to "" --html  --use-cradmin-email --message-html "Dette er <em>en test lizzm</em>"

From email can be set too! Defaults to the DEFAULT_FROM_EMAIL setting:

$ python ievv_developemail_send_testmail --to "" --from ""