Skip to content

Commit

Permalink
Merge pull request #1231 from nyaruka/wa_qr_tweak
Browse files Browse the repository at this point in the history
Truncate quick replies for template preview messages
  • Loading branch information
rowanseymour authored Mar 15, 2024
2 parents b07f34a + a210468 commit c30da27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flows/actions/send_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))
}
}

Expand Down

0 comments on commit c30da27

Please sign in to comment.