Use ‘name 1’ when sending yourself a message

We reckon this is better than ‘test name’, ‘test date’, etc.
This commit is contained in:
Chris Hill-Scott
2016-03-10 12:03:26 +00:00
parent 36cab58864
commit 25103aaef0

View File

@@ -166,7 +166,7 @@ def get_example_csv(service_id, template_id):
'email': current_user.email_address,
'sms': current_user.mobile_number
}[template.template_type]
] + ["test {}".format(header) for header in template.placeholders])
] + _get_fake_personalisation(template.placeholders))
return output.getvalue(), 200, {'Content-Type': 'text/csv; charset=utf-8'}
@@ -183,13 +183,11 @@ def send_message_to_self(service_id, template_id):
)
if template.template_type == 'sms':
writer.writerow(
[current_user.mobile_number] +
["test {}".format(header) for header in template.placeholders]
[current_user.mobile_number] + _get_fake_personalisation(template.placeholders)
)
if template.template_type == 'email':
writer.writerow(
[current_user.email_address] +
["test {}".format(header) for header in template.placeholders]
[current_user.email_address] + _get_fake_personalisation(template.placeholders)
)
filedata = {
@@ -280,3 +278,9 @@ def start_job(service_id, upload_id):
return redirect(
url_for('main.view_job', service_id=service_id, job_id=upload_id)
)
def _get_fake_personalisation(placeholders):
return [
"{} 1".format(header) for header in placeholders
]