From cd73dc8ff4cfa4949c22f05398c2baa957b2384c Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Thu, 30 Nov 2023 11:48:08 +0200 Subject: [PATCH] Adjust buttons params --- handlers/meta/handlers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handlers/meta/handlers.go b/handlers/meta/handlers.go index 7a0e42327..b5d545444 100644 --- a/handlers/meta/handlers.go +++ b/handlers/meta/handlers.go @@ -833,12 +833,12 @@ func (h *handler) sendWhatsAppMsg(ctx context.Context, msg courier.MsgOut, clog for _, p := range v { if strings.HasPrefix(p.Value, "http") { - component := &whatsapp.Component{Type: "button", Index: strings.TrimPrefix(k, "button."), SubType: "url"} - component.Params = append(component.Params, &whatsapp.Param{Type: p.Type, Text: p.Value}) + component := &whatsapp.Component{Type: "button", Index: strings.TrimPrefix(k, "button."), SubType: "quick_reply"} + component.Params = append(component.Params, &whatsapp.Param{Type: "url", Text: p.Value}) template.Components = append(template.Components, component) } else { - component := &whatsapp.Component{Type: "button", Index: strings.TrimPrefix(k, "button."), SubType: "payload"} - component.Params = append(component.Params, &whatsapp.Param{Type: p.Type, Payload: p.Value}) + component := &whatsapp.Component{Type: "button", Index: strings.TrimPrefix(k, "button."), SubType: "quick_reply"} + component.Params = append(component.Params, &whatsapp.Param{Type: "payload", Payload: p.Value}) template.Components = append(template.Components, component) } }