Skip to content

Commit

Permalink
Add email configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hancush committed Dec 11, 2024
1 parent 29d8da2 commit 8d83d21
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ AWS_S3_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=la-metro-headshots-staging
GOOGLE_API_KEY=
GOOGLE_SERVICE_ACCT_API_KEY=
DJANGO_EMAIL_HOST_PASSWORD=
WAGTAILADMIN_BASE_URL=http://localhost:8001
18 changes: 18 additions & 0 deletions councilmatic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,24 @@
AWS_KEY = env("AWS_KEY")
AWS_SECRET = env("AWS_SECRET")

# - Email configuration
try:
EMAIL_HOST_PASSWORD = os.environ["DJANGO_EMAIL_HOST_PASSWORD"]

except KeyError:
print("Email password not found, mail sending will not be available")

else:
if EMAIL_HOST_PASSWORD:
EMAIL_HOST = os.getenv("DJANGO_EMAIL_HOST", "smtp.mandrillapp.com")
EMAIL_PORT = os.getenv("DJANGO_EMAIL_PORT", 587)
EMAIL_HOST_USER = "lametro@councilmatic.org"
EMAIL_USE_TLS = True

DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
else:
print("Email password not found, mail sending will not be available")

# LOGGING
SENTRY_DSN = env("SENTRY_DSN")

Expand Down

0 comments on commit 8d83d21

Please sign in to comment.