-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
from django.utils.timezone import now | ||
from django.utils.translation import gettext_lazy as _ | ||
from rest_framework.test import APIRequestFactory | ||
from django.conf import settings | ||
|
||
from vespadb.observations.filters import MunicipalityExcludeFilter, ObserverReceivedEmailFilter, ProvinceFilter | ||
from vespadb.observations.forms import SendEmailForm | ||
|
@@ -305,7 +306,7 @@ def send_email_view(self, request: HttpRequest) -> HttpResponse: | |
fail_list.append(observation.id) | ||
continue | ||
try: | ||
send_mail(subject, message, "[email protected]", [observation.observer_email]) | ||
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [observation.observer_email]) | ||
logger.debug(f"Email sent to {observation.observer_email} for observation {observation.id}") | ||
observation.observer_received_email = True | ||
observation.save() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
"CELERY_BROKER_URL": os.getenv("CELERY_BROKER_URL"), | ||
"REDIS_REFRESH_RATE_MIN": os.getenv("REDIS_REFRESH_RATE_MIN", "15"), | ||
"DJANGO_DEBUG": os.getenv("DJANGO_DEBUG", "False"), | ||
"DEFAULT_FROM_EMAIL": os.getenv("DEFAULT_FROM_EMAIL", "[email protected]") | ||
} | ||
|
||
# Core settings | ||
|
@@ -266,4 +267,4 @@ | |
EMAIL_BACKEND = "django_ses.SESBackend" | ||
AWS_SES_REGION_NAME = "eu-west-1" | ||
AWS_SES_REGION_ENDPOINT = "email.eu-west-1.amazonaws.com" | ||
DEFAULT_FROM_EMAIL = "[email protected]" | ||
DEFAULT_FROM_EMAIL = secrets["DEFAULT_FROM_EMAIL"] |