Don’t validate phone numbers when sending emails

If you have a placeholder called `((phone number))` in your email
template, and you try to send a one-off message then the form input will
attempt to validate your ‘phone number’.

This is not helpful if you’re trying to put a landline number in your
email, for example.

This only affects messages being sent through the one-off interface.

This commit makes the form be aware of template type, which fixes the
problem.
This commit is contained in:
Chris Hill-Scott
2018-03-16 14:17:43 +00:00
parent b2c199e609
commit 5a2fafb66b
3 changed files with 34 additions and 18 deletions

View File

@@ -379,6 +379,7 @@ def send_test_step(service_id, template_id, step_index):
form = get_placeholder_form_instance(
current_placeholder,
dict_to_populate_from=get_normalised_placeholders_from_session(),
template_type=template.template_type,
optional_placeholder=optional_placeholder,
allow_international_phone_numbers='international_sms' in current_service['permissions'],
)