mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
fix broken go live email notification
This commit is contained in:
@@ -14,6 +14,7 @@ from app.notifications.process_notifications import (
|
|||||||
persist_notification,
|
persist_notification,
|
||||||
send_notification_to_queue,
|
send_notification_to_queue,
|
||||||
)
|
)
|
||||||
|
from app.utils import hilite
|
||||||
|
|
||||||
|
|
||||||
def send_notification_to_service_users(
|
def send_notification_to_service_users(
|
||||||
@@ -28,6 +29,7 @@ def send_notification_to_service_users(
|
|||||||
|
|
||||||
for user in active_users:
|
for user in active_users:
|
||||||
personalisation = _add_user_fields(user, personalisation, include_user_fields)
|
personalisation = _add_user_fields(user, personalisation, include_user_fields)
|
||||||
|
print(hilite(f"PERSONALISATION IS {personalisation}"))
|
||||||
notification = persist_notification(
|
notification = persist_notification(
|
||||||
template_id=template.id,
|
template_id=template.id,
|
||||||
template_version=template.version,
|
template_version=template.version,
|
||||||
@@ -43,6 +45,7 @@ def send_notification_to_service_users(
|
|||||||
key_type=KeyType.NORMAL,
|
key_type=KeyType.NORMAL,
|
||||||
reply_to_text=notify_service.get_default_reply_to_email_address(),
|
reply_to_text=notify_service.get_default_reply_to_email_address(),
|
||||||
)
|
)
|
||||||
|
print(hilite(f"NOTIFICATION IS {notification.serialize_for_csv()}"))
|
||||||
redis_store.set(
|
redis_store.set(
|
||||||
f"email-personalisation-{notification.id}",
|
f"email-personalisation-{notification.id}",
|
||||||
json.dumps(personalisation),
|
json.dumps(personalisation),
|
||||||
|
|||||||
@@ -83,7 +83,9 @@ def test_send_notification_to_service_users_sends_to_active_users_only(
|
|||||||
notify_service, mocker
|
notify_service, mocker
|
||||||
):
|
):
|
||||||
mocker.patch("app.service.sender.send_notification_to_queue")
|
mocker.patch("app.service.sender.send_notification_to_queue")
|
||||||
mocker.patch("app.service.sender.redis_store")
|
mocker.patch(
|
||||||
|
"app.service.sender.redis_store",
|
||||||
|
)
|
||||||
|
|
||||||
first_active_user = create_user(email="foo@bar.com", state="active")
|
first_active_user = create_user(email="foo@bar.com", state="active")
|
||||||
second_active_user = create_user(email="foo1@bar.com", state="active")
|
second_active_user = create_user(email="foo1@bar.com", state="active")
|
||||||
|
|||||||
Reference in New Issue
Block a user