Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add django-mailer to supported email schemes #386

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ Supported types
* SMTP: ``smtp://``
* SMTP+SSL: ``smtp+ssl://``
* SMTP+TLS: ``smtp+tls://``
* django-mailer: ``djangomailer://``
* django-mailer+SSL: ``djangomailer+ssl://``
* django-mailer+TLS: ``djangomailer+tls://``
* Console mail: ``consolemail://``
* File mail: ``filemail://``
* LocMem mail: ``memorymail://``
Expand Down
7 changes: 5 additions & 2 deletions environ/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ class Env:
'smtps': 'django.core.mail.backends.smtp.EmailBackend',
'smtp+tls': 'django.core.mail.backends.smtp.EmailBackend',
'smtp+ssl': 'django.core.mail.backends.smtp.EmailBackend',
'djangomailer': 'mailer.backend.DbBackend',
'djangomailer+tls': 'mailer.backend.DbBackend',
'djangomailer+ssl': 'mailer.backend.DbBackend',
'consolemail': 'django.core.mail.backends.console.EmailBackend',
'filemail': 'django.core.mail.backends.filebased.EmailBackend',
'memorymail': 'django.core.mail.backends.locmem.EmailBackend',
Expand Down Expand Up @@ -651,9 +654,9 @@ def email_url_config(cls, url, backend=None):
elif url.scheme in cls.EMAIL_SCHEMES:
config['EMAIL_BACKEND'] = cls.EMAIL_SCHEMES[url.scheme]

if url.scheme in ('smtps', 'smtp+tls'):
if url.scheme in ('smtps', 'smtp+tls', 'djangomailer+tls'):
config['EMAIL_USE_TLS'] = True
elif url.scheme == 'smtp+ssl':
elif url.scheme in ('smtp+ssl', 'djangomailer+ssl'):
config['EMAIL_USE_SSL'] = True

if url.query:
Expand Down