diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py index 2a533bc30..00199291b 100644 --- a/app/main/views/notifications.py +++ b/app/main/views/notifications.py @@ -95,6 +95,8 @@ def view_notification(service_id, notification_id): page_count=page_count, show_recipient=True, redact_missing_personalisation=True, + sms_sender=notification['reply_to_text'], + email_reply_to=notification['reply_to_text'], ) template.values = personalisation if notification['job']: diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index 3160c4cff..0a44ee326 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -949,3 +949,22 @@ def test_cancelling_a_letter_calls_the_api( ) assert cancel_endpoint.called + + +@pytest.mark.parametrize('notification_type', ['sms', 'email']) +def test_should_show_reply_to_from_notification( + mocker, + fake_uuid, + notification_type, + client_request, +): + notification = create_notification(reply_to_text='reply to info', template_type=notification_type) + mocker.patch('app.notification_api_client.get_notification', return_value=notification) + + page = client_request.get( + 'main.view_notification', + service_id=SERVICE_ONE_ID, + notification_id=fake_uuid, + ) + + assert 'reply to info' in page.text diff --git a/tests/conftest.py b/tests/conftest.py index e1d8eee1d..98e2a551e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4174,13 +4174,15 @@ def create_notification( key_type=None, postage=None, sent_one_off=True, + reply_to_text=None, ): noti = notification_json( service_id, rows=1, status=notification_status, template_type=template_type, - postage=postage + postage=postage, + reply_to_text=reply_to_text, )['notifications'][0] noti['id'] = notifification_id or sample_uuid()