Skip to content

Commit a9bdd48

Browse files
committed
Make parameter with type url to be sent as url buttons
1 parent db7ae80 commit a9bdd48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: handlers/meta/whatsapp/templates.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func GetTemplatePayload(templating MsgTemplating) *Template {
5252
if strings.HasPrefix(k, "button.") {
5353

5454
for _, p := range v {
55-
if strings.HasPrefix(p.Value, "http") {
55+
if p.Type == "url" || strings.HasPrefix(p.Value, "http") {
5656
component := &Component{Type: "button", Index: strings.TrimPrefix(k, "button."), SubType: "quick_reply"}
57-
component.Params = append(component.Params, &Param{Type: "url", Text: p.Value})
57+
component.Params = append(component.Params, &Param{Type: "text", Text: p.Value})
5858
template.Components = append(template.Components, component)
5959
} else {
6060
component := &Component{Type: "button", Index: strings.TrimPrefix(k, "button."), SubType: "quick_reply"}

0 commit comments

Comments
 (0)