File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ package whatsapp
2
2
3
3
import (
4
4
"encoding/json"
5
+ "sort"
5
6
"strings"
6
7
7
8
"github.com/nyaruka/courier"
8
9
"github.com/nyaruka/courier/utils"
9
10
"github.com/pkg/errors"
11
+ "golang.org/x/exp/maps"
10
12
)
11
13
12
14
type MsgTemplating struct {
@@ -48,7 +50,12 @@ func GetTemplating(msg courier.MsgOut) (*MsgTemplating, error) {
48
50
func GetTemplatePayload (templating MsgTemplating ) * Template {
49
51
template := & Template {Name : templating .Template .Name , Language : & Language {Policy : "deterministic" , Code : templating .Language }}
50
52
51
- for k , v := range templating .Params {
53
+ compKeys := maps .Keys (templating .Params )
54
+ sort .Strings (compKeys ) // so that final component order is deterministic
55
+
56
+ for _ , k := range compKeys {
57
+ v := templating .Params [k ]
58
+
52
59
if strings .HasPrefix (k , "button." ) {
53
60
54
61
for _ , p := range v {
You can’t perform that action at this time.
0 commit comments