Skip to content

Commit

Permalink
Fixed email settings
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Jun 19, 2018
1 parent 9ca6d1d commit 8472462
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ DJANGO_GOOGLE_ANALYTICS_TRACKING_ID="<change me>"
DJANGO_MANAGERS="name <email>"
DJANGO_SECURE="true"
DJANGO_USE_AWS_STORAGE="true"
GENERAL_EMAIL_RECEPIENTS="name <email>"
PRESS_EMAIL_RECEPIENTS="name <email>"
SERVICE_EMAIL_RECEPIENTS="name <email>"

# Private
AWS_ACCESS_KEY_ID="<change me>"
Expand All @@ -22,9 +25,9 @@ CACHE_URL=redis://localhost:6379/0
DATABASE_URL="postgres://user:pass@localhost:5432/okfn"
DJANGO_CSP_REPORT_URI="<change me>"
DJANGO_EMAIL_HOST="<change me>"
DJANGO_EMAIL_PORT="<change me>"
DJANGO_EMAIL_USER="<change me>"
DJANGO_EMAIL_HOST_USER="<change me>"
DJANGO_EMAIL_HOST_PASSWORD="<change me>"
DJANGO_EMAIL_PORT="<change me>"
DJANGO_MAILCHIMP_TOKEN="<change me>"
DJANGO_MAILCHIMP_URL="<change me>"
DJANGO_SECRET_KEY="<change me>"
Expand Down
14 changes: 4 additions & 10 deletions foundation/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,10 @@ def _parse_email_list(varname):
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
else:
EMAIL_USE_TLS = env.get('DJANGO_EMAIL_USE_TLS', 'true') == 'true'
if 'MANDRILL_USERNAME' in env:
EMAIL_HOST = 'smtp.mandrillapp.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = env['MANDRILL_USERNAME']
EMAIL_HOST_PASSWORD = env['MANDRILL_APIKEY']
else:
EMAIL_HOST = env.get('DJANGO_EMAIL_HOST', 'localhost')
EMAIL_PORT = env.get('DJANGO_EMAIL_PORT', '25')
EMAIL_HOST_USER = env.get('DJANGO_EMAIL_USER', 'mail')
EMAIL_HOST_PASSWORD = env.get('DJANGO_EMAIL_HOST_PASSWORD', 'mail')
EMAIL_HOST = env.get('DJANGO_EMAIL_HOST', 'localhost')
EMAIL_HOST_USER = env.get('DJANGO_EMAIL_HOST_USER', 'mail')
EMAIL_HOST_PASSWORD = env.get('DJANGO_EMAIL_HOST_PASSWORD', 'mail')
EMAIL_PORT = env.get('DJANGO_EMAIL_PORT', '25')

# set default email sender account for contact form enquiries
CONTACT_EMAIL_SENDER = env.get('CONTACT_EMAIL_SENDER')
Expand Down

0 comments on commit 8472462

Please sign in to comment.