Configure mail provider

This commit is contained in:
Oleg Lavrovsky 2017-04-05 23:50:38 +02:00
parent 1c37dfa1bd
commit c88df8e7c3
3 changed files with 12 additions and 4 deletions

View file

@ -44,6 +44,7 @@ INSTALLED_APPS = [
'compressor',
'taggit',
'puput',
'anymail',
'django.contrib.admin',
'django.contrib.auth',
@ -187,10 +188,6 @@ WAGTAILSEARCH_BACKENDS = {
},
}
# Email settings
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# Wagtail settings
WAGTAIL_SITE_NAME = "Public Health Schweiz"

View file

@ -87,6 +87,16 @@ else:
}
# Email via ESP
if 'MAILGUN_KEY' in os.environ:
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
ANYMAIL = {
"MAILGUN_API_KEY": env['MAILGUN_KEY'],
"MAILGUN_SENDER_DOMAIN": env['MAILGUN_DOMAIN']
}
DEFAULT_FROM_EMAIL = env['MAILGUN_FROM']
# Redis
# Redis location can either be passed through with REDIS_HOST or REDIS_SOCKET

View file

@ -29,3 +29,4 @@ stellar==0.4.3
gunicorn==19.7.1
whitenoise==3.3.0
ConcurrentLogHandler==0.9.1
django-anymail==0.9