Adding the personalization message back in

This commit is contained in:
Jonathan Bobel
2025-03-19 11:30:01 -04:00
parent 7afdf7336a
commit b5203f473a
2 changed files with 8 additions and 2 deletions

View File

@@ -707,6 +707,12 @@ def _get_content_count_error_and_message_for_template(template):
f"too many" f"too many"
) )
if template.placeholders:
return False, Markup(
f"Will be charged as {message_count(template.fragment_count, template.template_type)} "
f"(not including personalization). {warning}"
)
# If there's a warning, return it alone and hide the "Will be charged as..." text # If there's a warning, return it alone and hide the "Will be charged as..." text
if warning: if warning:
return False, Markup(warning) return False, Markup(warning)

View File

@@ -2060,7 +2060,7 @@ def test_set_template_sender(
"sms", "sms",
False, False,
"Hello ((name))", "Hello ((name))",
"Will be charged as 1 text message.", "Will be charged as 1 text message (not including personalization).",
None, None,
), ),
( (
@@ -2068,7 +2068,7 @@ def test_set_template_sender(
"sms", "sms",
False, False,
f'Hello (( {"a" * 999} ))', f'Hello (( {"a" * 999} ))',
"Will be charged as 1 text message.", "Will be charged as 1 text message (not including personalization).",
None, None,
), ),
], ],