Skip to content

Commit a210468

Browse files
committed
Truncate quick replies for template preview messages
1 parent b07f34a commit a210468

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flows/actions/send_msg.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"strings"
55

66
"github.com/nyaruka/gocommon/i18n"
7+
"github.com/nyaruka/gocommon/stringsx"
78
"github.com/nyaruka/gocommon/urns"
89
"github.com/nyaruka/gocommon/uuids"
910
"github.com/nyaruka/goflow/assets"
@@ -181,7 +182,7 @@ func (a *SendMsgAction) getTemplateMsg(run flows.Run, urn urns.URN, channelRef *
181182
var previewQRs []string
182183
for _, key := range utils.SortedKeys(preview) {
183184
if strings.HasPrefix(key, "button.") {
184-
previewQRs = append(previewQRs, preview[key])
185+
previewQRs = append(previewQRs, stringsx.TruncateEllipsis(preview[key], maxQuickReplyLength))
185186
}
186187
}
187188

0 commit comments

Comments
 (0)