diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 4733bbad..3c557937 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -36,6 +36,7 @@ INSTALLED_APPS = [ # 'theme', # External apps + 'mailer', 'polymorphic', 'crispy_forms', 'django_tables2', diff --git a/note_kfet/settings/production.py b/note_kfet/settings/production.py index c22bca60..d7c51ebc 100644 --- a/note_kfet/settings/production.py +++ b/note_kfet/settings/production.py @@ -33,7 +33,8 @@ ALLOWED_HOSTS = [os.environ.get('NOTE_URL', 'localhost')] SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'CHANGE_ME_IN_ENV_SETTINGS') # Emails -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' +EMAIL_BACKEND = 'mailer.backend.DbBackend' # Mailer place emails in a queue before sending them to avoid spam +MAILER_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_SSL = False EMAIL_HOST = os.getenv('EMAIL_HOST', 'smtp.example.org') EMAIL_PORT = os.getenv('EMAIL_PORT', 465) diff --git a/requirements/base.txt b/requirements/base.txt index 7da788e3..d6e5b075 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,6 +6,7 @@ django-allauth==0.39.1 django-crispy-forms==1.7.2 django-extensions==2.1.9 django-filter==2.2.0 +django-mailer==2.0.1 django-polymorphic==2.0.3 django-tables2==2.1.0 docutils==0.14