From a210468c0dd273cd2e4b07184c1512aa4bc78cc6 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Fri, 15 Mar 2024 09:04:38 -0500 Subject: [PATCH] Truncate quick replies for template preview messages --- flows/actions/send_msg.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flows/actions/send_msg.go b/flows/actions/send_msg.go index 9cf832899..67539a62f 100644 --- a/flows/actions/send_msg.go +++ b/flows/actions/send_msg.go @@ -4,6 +4,7 @@ import ( "strings" "github.com/nyaruka/gocommon/i18n" + "github.com/nyaruka/gocommon/stringsx" "github.com/nyaruka/gocommon/urns" "github.com/nyaruka/gocommon/uuids" "github.com/nyaruka/goflow/assets" @@ -181,7 +182,7 @@ func (a *SendMsgAction) getTemplateMsg(run flows.Run, urn urns.URN, channelRef * var previewQRs []string for _, key := range utils.SortedKeys(preview) { if strings.HasPrefix(key, "button.") { - previewQRs = append(previewQRs, preview[key]) + previewQRs = append(previewQRs, stringsx.TruncateEllipsis(preview[key], maxQuickReplyLength)) } }