Skip to content

Commit

Permalink
Add comments to sendcloud presign string formation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chankiyu22 committed Sep 24, 2024
1 parent 081fbbd commit 5e2df93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/lib/infra/sms/sendcloud/models/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func NewSendRequest(

func (r *SendRequest) Presign() string {
vars, _ := json.Marshal(r.vars)

// According to the [doc](https://www.sendcloud.net/doc/sms/),
// - The keys should be arranged alphabetically
// - The values no need to be url encoded
return strings.Join([]string{
fmt.Sprintf("msgType=%v", r.msgType),
fmt.Sprintf("phone=%v", strings.Join(r.phone, ",")),
Expand Down

0 comments on commit 5e2df93

Please sign in to comment.