mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 01:55:41 -04:00
Change content for email reply-to verification journey
Earlier commits used placeholder content while awaiting official content.
This commit is contained in:
@@ -422,7 +422,9 @@ def service_add_email_reply_to(service_id):
|
||||
'.service_verify_reply_to_address',
|
||||
service_id=service_id,
|
||||
notification_id=notification_id
|
||||
) + "?is_default={}".format(is_default))
|
||||
) + "?is_default={}".format(is_default)
|
||||
+ "&is_new=True"
|
||||
)
|
||||
|
||||
return render_template(
|
||||
'views/service-settings/email-reply-to/add.html',
|
||||
@@ -434,11 +436,13 @@ def service_add_email_reply_to(service_id):
|
||||
@login_required
|
||||
@user_has_permissions('manage_service')
|
||||
def service_verify_reply_to_address(service_id, notification_id):
|
||||
is_new = request.args.get('is_new', False)
|
||||
return render_template(
|
||||
'views/service-settings/email-reply-to/verify.html',
|
||||
service_id=service_id,
|
||||
notification_id=notification_id,
|
||||
partials=get_service_verify_reply_to_address_partials(service_id, notification_id)
|
||||
partials=get_service_verify_reply_to_address_partials(service_id, notification_id),
|
||||
verb=("Add" if is_new else "Change")
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
{% from "components/banner.html" import banner %}
|
||||
{% from "components/banner.html" import banner, banner_wrapper %}
|
||||
|
||||
<div class="ajax-block-container">
|
||||
{% if verification_status == "pending" %}
|
||||
<p>
|
||||
We have sent a notification to {{ reply_to_email_address }} to check if it's a working email address.
|
||||
|
||||
We’re checking that ‘{{ reply_to_email_address }}’ is a real email address.
|
||||
</p>
|
||||
<p>
|
||||
Once we receive a delivery confirmation, we will update your list of reply-to email addresses.
|
||||
<span class='loading-indicator'>This can take a minute </span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{{ url_for('main.service_verify_reply_to_address', service_id=service_id, notification_id=notification_id) + "?is_default={}".format(is_default) }}"">Refresh</a>
|
||||
</p>
|
||||
{% elif verification_status == "success" %}
|
||||
{{ banner("Yay success! Your new reply-to email has been added ^__^", type='default', with_tick=True) }}
|
||||
{{ banner("‘{}’ is ready to use".format(reply_to_email_address), type='default', with_tick=True) }}
|
||||
{% elif verification_status == "failure" %}
|
||||
{{ banner("Sorry dawg, this email address doesn't seem to be working :d", type='dangerous') }}
|
||||
{% call banner_wrapper(type='dangerous') %}
|
||||
<h2 class='banner-title' data-module="track-error" data-error-type="reply-to-email-not-working" data-error-label="{{ upload_id }}">
|
||||
There’s a problem with your reply-to address
|
||||
</h2>
|
||||
<p>
|
||||
We sent an email to ‘{{ reply_to_email_address }}’ but it wasn’t delivered.
|
||||
</p>
|
||||
<p>
|
||||
You can try again, or use a different address.
|
||||
</p>
|
||||
{% endcall %}
|
||||
<a href={{ url_for('main.service_add_email_reply_to', service_id=service_id) }}>Try again</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
{% from "components/ajax-block.html" import ajax_block %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Verifying your reply-to email address
|
||||
{{ verb }} email reply-to address
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{{ page_header(
|
||||
'Verifying your reply-to email address',
|
||||
'{} email reply-to address'.format(verb),
|
||||
back_link=url_for('main.service_email_reply_to', service_id=current_service.id)
|
||||
) }}
|
||||
{{ ajax_block(
|
||||
|
||||
@@ -2026,11 +2026,12 @@ def test_add_reply_to_email_address_sends_test_notification(
|
||||
notification_id="123",
|
||||
_external=True,
|
||||
) + "?is_default={}".format(api_default_args)
|
||||
+ "&is_new=True"
|
||||
)
|
||||
mock_verify.assert_called_once_with(SERVICE_ONE_ID, "test@example.com")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("is_default", [True, False])
|
||||
@pytest.mark.parametrize("is_default,is_new,expected_header", [(True, "&is_new=True", "Add"), (False, "", "Change")])
|
||||
@pytest.mark.parametrize("status,expected_failure,expected_success", [
|
||||
("delivered", 0, 1),
|
||||
("sending", 0, 0),
|
||||
@@ -2038,7 +2039,7 @@ def test_add_reply_to_email_address_sends_test_notification(
|
||||
])
|
||||
@freeze_time("2018-06-01 11:11:00.061258")
|
||||
def test_service_verify_reply_to_address(
|
||||
mocker, client_request, fake_uuid, status, expected_failure, expected_success, is_default
|
||||
mocker, client_request, fake_uuid, status, expected_failure, expected_success, is_default, is_new, expected_header
|
||||
):
|
||||
notification = {
|
||||
"id": fake_uuid,
|
||||
@@ -2058,9 +2059,9 @@ def test_service_verify_reply_to_address(
|
||||
'main.service_verify_reply_to_address',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=notification["id"],
|
||||
_optional_args="?is_default={}".format(is_default)
|
||||
_optional_args="?is_default={}{}".format(is_default, is_new)
|
||||
)
|
||||
assert page.find('h1').text == 'Verifying your reply-to email address'
|
||||
assert page.find('h1').text == '{} email reply-to address'.format(expected_header)
|
||||
assert len(page.find_all('div', class_='banner-dangerous')) == expected_failure
|
||||
assert len(page.find_all('div', class_='banner-default-with-tick')) == expected_success
|
||||
|
||||
@@ -2096,7 +2097,7 @@ def test_add_reply_to_email_address_fails_if_notification_not_delivered_in_5_min
|
||||
_optional_args="?is_default={}".format(False)
|
||||
)
|
||||
expected_banner = page.find_all('div', class_='banner-dangerous')[0]
|
||||
assert expected_banner.text.strip() == "Sorry dawg, this email address doesn't seem to be working :d"
|
||||
assert 'There’s a problem with your reply-to address' in expected_banner.text.strip()
|
||||
mock_add_reply_to_email_address.assert_not_called()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user