From a790c2f9c7cf9ae739c4b99d93c66247b021288a Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 26 Jan 2024 11:42:30 -0800 Subject: [PATCH] notify-admin-1158 fix email sending --- app/notifications/process_notifications.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/notifications/process_notifications.py b/app/notifications/process_notifications.py index 0b46c8b7c..1ace61df4 100644 --- a/app/notifications/process_notifications.py +++ b/app/notifications/process_notifications.py @@ -9,6 +9,7 @@ from notifications_utils.recipients import ( ) from notifications_utils.template import PlainTextEmailTemplate, SMSMessageTemplate +from app import redis_store from app.celery import provider_tasks from app.config import QueueNames from app.dao.notifications_dao import ( @@ -123,7 +124,11 @@ def persist_notification( notification.rate_multiplier = recipient_info.billable_units elif notification_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 not simulated: