Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email configuration #1188

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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