Skip to content

Commit

Permalink
feat: fix Tencent SMS ignored error issue (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacongda authored Nov 29, 2024
1 parent 9fc8a7e commit af78ac0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tencent.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ func (c *TencentClient) SendMessage(param map[string]string, targetPhoneNumber .
request.TemplateId = common.StringPtr(c.template)
request.PhoneNumberSet = common.StringPtrs(targetPhoneNumber)

_, err := c.core.SendSms(request)
response, err := c.core.SendSms(request)
if err != nil {
return err
}
if len(response.Response.SendStatusSet) > 0 && response.Response.SendStatusSet[0].Code != nil && *response.Response.SendStatusSet[0].Code != "Ok" {
return fmt.Errorf(*response.Response.SendStatusSet[0].Message)
}
return err
}

0 comments on commit af78ac0

Please sign in to comment.