diff --git a/app/main/views/send.py b/app/main/views/send.py index 8764406c4..dbfb3421b 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -907,8 +907,11 @@ def get_template_error_dict(exception): error = 'not-allowed-to-send-to' elif 'Exceeded send limits' in exception.message: error = 'too-many-messages' + # the error from the api is changing for message-too-long, but we need both until the api is deployed. elif 'Content for template has a character count greater than the limit of' in exception.message: error = 'message-too-long' + elif 'Text messages cannot be longer than' in exception.message: + error = 'message-too-long' else: raise exception diff --git a/app/templates/partials/check/message-too-long.html b/app/templates/partials/check/message-too-long.html index 6aea90a64..9b07ca20b 100644 --- a/app/templates/partials/check/message-too-long.html +++ b/app/templates/partials/check/message-too-long.html @@ -1,13 +1,7 @@ -{% from "components/banner.html" import banner_wrapper %} - -
- Text messages cannot be longer than {{ SMS_CHAR_COUNT_LIMIT }} characters. - Your message is {{ template.content_count }} characters. -
- {% endcall %} -+ Text messages cannot be longer than {{ SMS_CHAR_COUNT_LIMIT }} characters. + Your message is {{ template.content_count }} characters. +
diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 34d62fd69..79d7f8758 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -3560,7 +3560,7 @@ TRIAL_MODE_MSG = ( 'Cannot send to this recipient when service is in trial mode – ' 'see https://www.notifications.service.gov.uk/trial-mode' ) -TOO_LONG_MSG = 'Content for template has a character count greater than the limit of 612' +TOO_LONG_MSG = 'Text messages cannot be longer than 612 characters. Your message is 654 characters.' SERVICE_DAILY_LIMIT_MSG = 'Exceeded send limits (1000) for today'