mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 10:12:32 -05:00
Merge pull request #768 from GSA/notify-admin-1158
notify-admin-1158 fix email sending
This commit is contained in:
@@ -9,6 +9,7 @@ from notifications_utils.recipients import (
|
|||||||
)
|
)
|
||||||
from notifications_utils.template import PlainTextEmailTemplate, SMSMessageTemplate
|
from notifications_utils.template import PlainTextEmailTemplate, SMSMessageTemplate
|
||||||
|
|
||||||
|
from app import redis_store
|
||||||
from app.celery import provider_tasks
|
from app.celery import provider_tasks
|
||||||
from app.config import QueueNames
|
from app.config import QueueNames
|
||||||
from app.dao.notifications_dao import (
|
from app.dao.notifications_dao import (
|
||||||
@@ -123,7 +124,11 @@ def persist_notification(
|
|||||||
notification.rate_multiplier = recipient_info.billable_units
|
notification.rate_multiplier = recipient_info.billable_units
|
||||||
elif notification_type == EMAIL_TYPE:
|
elif notification_type == EMAIL_TYPE:
|
||||||
current_app.logger.info(f"Persisting notification with type: {EMAIL_TYPE}")
|
current_app.logger.info(f"Persisting notification with type: {EMAIL_TYPE}")
|
||||||
notification.normalised_to = format_email_address(notification.to)
|
redis_store.set(
|
||||||
|
f"email-address-{notification.id}",
|
||||||
|
format_email_address(notification.to),
|
||||||
|
ex=1800,
|
||||||
|
)
|
||||||
|
|
||||||
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
# if simulated create a Notification model to return but do not persist the Notification to the dB
|
||||||
if not simulated:
|
if not simulated:
|
||||||
|
|||||||
Reference in New Issue
Block a user