From da956fe90146f7f90063edf8a2765997bb702f2e Mon Sep 17 00:00:00 2001 From: Matthew Cengia Date: Wed, 27 Mar 2024 18:12:13 +1100 Subject: [PATCH] Add option for file-based email backend --- .env.example | 2 ++ django/myproject/settings.py | 1 + 2 files changed, 3 insertions(+) diff --git a/.env.example b/.env.example index e465126..fc08aa3 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/django/myproject/settings.py b/django/myproject/settings.py index 1540c6d..85d171b 100644 --- a/django/myproject/settings.py +++ b/django/myproject/settings.py @@ -184,5 +184,6 @@ 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=""))])