Add option for file-based email backend

This commit is contained in:
Matt Cengia 2024-03-27 18:12:13 +11:00
parent 5e571ca947
commit da956fe901
Signed by: mattcen
GPG Key ID: F22DB9DE406C9233
2 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,8 @@ ALLOWED_HOSTS=*
# By default, emails get sent to the local console
#EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
#EMAIL_BACKEND=django.core.mail.backends.filebased.EmailBackend
#EMAIL_FILE_PATH = "/tmp/django-messages"
# To set up an SMTP server, set the following (only EMAIL_BACKEND is required)
#EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
#EMAIL_HOST=mail

View File

@ -184,5 +184,6 @@ EMAIL_SSL_KEYFILE = env("EMAIL_SSL_KEYFILE", default=None)
EMAIL_SSL_CERTFILE = env("EMAIL_SSL_CERTFILE", default=None)
DEFAULT_FROM_EMAIL = env("DEFAULT_FROM_EMAIL", default="webmaster@localhost")
SERVER_EMAIL = env("SERVER_EMAIL", default=DEFAULT_FROM_EMAIL)
EMAIL_FILE_PATH = env("EMAIL_FILE_PATH", default="/tmp/django-messages")
ADMINS = email.utils.getaddresses(["To: %s" % (env("ADMINS", default=""))])