Package: django-mail-admin
The one and only django app to receive & send mail with templates and multiple configurations.ScreenshotsFeaturesEverything django-mailbox hasEverything django-post-office hasEverything django-db-email-backend hasDatabase configurations - activate an outbox to send from, activate a mailbox to receive fromTemplatesTranslatableMailings - using send_many() or ‘cc’ and ‘bcc’ or even recipients - all of those accept comma-separated lists of emailsDependenciesdjango >= 1.9django-jsonfieldDocumentationThe full documentation is athttps://django-mail-admin.readthedocs.io.QuickstartQ: What versions of Django/Python are supported?A: Take a look athttps://travis-ci.org/delneg/django_mail_adminInstall django mail admin:pip install django_mail_adminAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_mail_admin',...)Runmigrate:python manage.py migrate django_mail_adminSetdjango_mail_admin.backends.CustomEmailBackendas yourEMAIL_BACKENDin django’ssettings.py:EMAIL_BACKEND = 'django_mail_admin.backends.CustomEmailBackend'Set cron/Celery/RQ job to send/receive email, e.g.* * * * * (cd $PROJECT; python manage.py send_queued_mail --processes=1 >> $PROJECT/cron_mail.log 2>&1)
* * * * * (cd $PROJECT; python manage.py get_new_mail >> $PROJECT/cron_mail_receive.log 2>&1)
0 1 * * * (cd $PROJECT; python manage.py cleanup_mail --days=30 >> $PROJECT/cron_mail_cleanup.log 2>&1)NoteOnce you have entered a mailbox to receive emails, you can easily verify that you
have properly configured your mailbox by either:From the Django Admin, using the ‘Get New Mail’ action from the action
dropdown on the Mailbox changelistOrfrom a shell opened to your project’s directory, using theget_new_mailmanagement command by running:python manage.py get_new_mailIf you have also configured the Outbox, you can verify that it is working, e.g.from django_mail_admin import mail, models

mail.send(
    'from@example.com',
    'recipient@example.com', # List of email addresses also accepted
    subject='My email',
    message='Hi there!',
    priority=models.PRIORITY.now,
    html_message='Hi <strong>there</strong>!',
)Custom Email BackendsBy default,django_mail_adminuses custom Email Backends that looks up for Outbox models in database. If you want to
use a different backend, you can do so by configuringBACKENDS, though you will not be able to use Outboxes and will have to set EMAIL_HOST etc. in django’ssettings.py.For example if you want to usedjango-ses:DJANGO_MAIL_ADMIN = {
    'BACKENDS': {
        'default': 'django_mail_admin.backends.CustomEmailBackend',
        'smtp': 'django.core.mail.backends.smtp.EmailBackend',
        'ses': 'django_ses.SESBackend',
    }
}You can then choose what backend you want to use when sending mail:# If you omit `backend_alias` argument, `default` will be usedmail.send('from@example.com',['recipient@example.com'],subject='Hello',)# If you want to send using `ses` backendmail.send('from@example.com',['recipient@example.com'],subject='Hello',backend='ses',)Capture outgoing emails into OutboxIf you want to store outgoing emails in the Outbox before they are submitted
to the backend, setdjango_mail_admin.backends.OutboxEmailBackendas yourEMAIL_BACKENDin django’ssettings.py:EMAIL_BACKEND='django_mail_admin.backends.OutboxEmailBackend'Emails submitted usingdjango.core.mail.send_mailwill be stored in
the Outbox with the default backend selected for use when sending.The emails will remain in the Outbox untilsend_queued_mailis run.This can be used on development and test environments to capture emails
so they are not sent automatically, and can be reviewed in Django Admin
to ensure the contents are correct.Optional requirementsdjango_admin_row_actionsfor some useful actions in the admin interfacerequests&social-auth-app-djangofor GmailFAQQ: Why did you write this?A: In order to get both email sending & receiving you’ll have to install post_office AND django_mailbox.
Even if you do, you’ll have to work on admin interface for it to look prettier, somehow link replies properly etc.
So I’ve decided merging those two and clearing the mess in between them as well as adding some other useful features.Q: Why did you remove support for Python 2?A: Because f*ck python2. Really, it’s been 9 (NINE!) years since it came out. Go ahead and check outhttps://github.com/brettcannon/caniusepython3Q: Why is it named django_mail_admin, what does it have to do with admin ?A: Well, the first version of this package (which was living just in a really large admin.py) was used for easy mail management using standard Django admin interface.Q: What languages are available?A: Currently there’s Russian and English languages available. Feel free to add yours:source <YOURVIRTUALENV>/bin/activate
python manage.py makemessages -l YOUR_LOCALE -i venv
python manage.py compilemessages -l YOUR_LOCALEQ: Why did you delete support for multi-lingual templates?A: Well, we have django-model-translations for that. You can easily fork this app and override EmailTemplate model (models/templates.py) accordingly.
I think there’s no need for such an overhead in a mail-related app.Q: I don’t want my outgoing emails to be queued for sending after saving them in the admin interface, what do i do?A: Just override OutgoingEmailAdmin’s save_model method.Q: Can i get in touch with you? I want a new feature to be implemented/bug fixed!A: Feel free to reach me out using issues and pull requests, I’ll review them all and answer when I can.Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage