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, 'email': current_user.email_address,
'sms': current_user.mobile_number 'sms': current_user.mobile_number
}[template.template_type] }[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'} 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': if template.template_type == 'sms':
writer.writerow( writer.writerow(
[current_user.mobile_number] + [current_user.mobile_number] + _get_fake_personalisation(template.placeholders)
["test {}".format(header) for header in template.placeholders]
) )
if template.template_type == 'email': if template.template_type == 'email':
writer.writerow( writer.writerow(
[current_user.email_address] + [current_user.email_address] + _get_fake_personalisation(template.placeholders)
["test {}".format(header) for header in template.placeholders]
) )
filedata = { filedata = {
@@ -280,3 +278,9 @@ def start_job(service_id, upload_id):
return redirect( return redirect(
url_for('main.view_job', service_id=service_id, job_id=upload_id) 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
]