Put template name on preview page

We’ve had a couple of instances where teams have sent the wrong template
to a …number of users.

Sometimes templates can be very similar and only have slight variations
to tailor them to a specific subset of users. So identifying the right
template by sight can be difficult.

We know that teams do give their templates meaningful names, and use
these names in other tools (spreadsheets etc) to refer to the templates.

So putting the name of the template on the page where you’re about to
send all the messages seems like it’s gives people an easier way of
double checking that they’re doing the right thing.

I umm’d and ahh’d over the wording a bit, and think ‘Preview of…’ reads
the best. It looks a bit weird because most template names are Title
Case. I think it’s better than some ambiguous punctuation (eg ‘Preview:
Template name’ or ‘Template name – preview’).

Some examples of real template names:
- Preview of Example text message templates
- Preview of Online LPA payment application reminder
- Preview of Create user account
- Preview of Split journey - Unknown credentials
- Preview of Public user: application without supporting documents
- Preview of Renewal Survey – February
- Preview of CEX New adult
- Preview of Applications are closing tomorrow
- Preview of Your application result - if successful
This commit is contained in:
Chris Hill-Scott
2017-02-10 10:23:08 +00:00
parent 5f37fc158d
commit 457249c0fa
2 changed files with 27 additions and 1 deletions

View File

@@ -150,7 +150,7 @@
{% else %}
<h1 class="heading-large">
Preview
Preview of {{ template.name }}
</h1>
{{ skip_to_file_contents() }}

View File

@@ -207,6 +207,32 @@ def test_upload_csv_invalid_extension(
assert "invalid.txt isnt a spreadsheet that Notify can read" in resp.get_data(as_text=True)
def test_upload_valid_csv_shows_page_title(
logged_in_client,
mocker,
mock_get_service_template_with_placeholders,
mock_s3_upload,
mock_get_users_by_service,
mock_get_detailed_service_for_today,
service_one,
fake_uuid,
):
mocker.patch('app.main.views.send.s3download', return_value="""
phone number,name\n07700900986,Jo
""")
response = logged_in_client.post(
url_for('main.send_messages', service_id=service_one['id'], template_id=fake_uuid),
data={'file': (BytesIO(''.encode('utf-8')), 'valid.csv')},
follow_redirects=True,
)
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.text.strip() == 'Preview of Two week reminder'
def test_send_test_sms_message(
logged_in_client,
mocker,