Skip to content

Commit

Permalink
Merge pull request #5107 from nyaruka/fix-url-buttons
Browse files Browse the repository at this point in the history
Add url param type for buttons with URLs
  • Loading branch information
rowanseymour authored Mar 15, 2024
2 parents 01323c6 + 6a0d17b commit 3955978
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion temba/utils/whatsapp/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _extract_template_params(components):
display = ""
if button["type"].lower() == "url":
for match in VARIABLE_RE.findall(button.get("url", "")):
comp_params.append({"type": "text"})
comp_params.append({"type": "url"})
content = button.get("url", "")
display = button.get("text", "")
if comp_params:
Expand Down
4 changes: 2 additions & 2 deletions temba/utils/whatsapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def test_update_local_templates_whatsapp(self):
"button.3": {
"content": r"https:\/\/example.com\/?wa_customer={{1}}",
"display": "Check website",
"params": [{"type": "text"}],
"params": [{"type": "url"}],
},
"button.4": {"content": r"https:\/\/example.com\/help", "display": "Check website", "params": []},
},
Expand All @@ -291,7 +291,7 @@ def test_update_local_templates_whatsapp(self):
{
"header": [{"type": "image"}],
"body": [{"type": "text"}, {"type": "text"}],
"button.3": [{"type": "text"}],
"button.3": [{"type": "url"}],
},
ct.params,
)
Expand Down

0 comments on commit 3955978

Please sign in to comment.