短信发送方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
646 B

package sms
import (
"testing"
)
func Test_SendByTencent(t *testing.T) {
secretId := "AKIDObaKq9NRFn6A2iBaOxGKBoqeEbjdT5Vg"
secretKey := "0mLiqlU0IMwIOEqGWYMxLVREsMelhT3R"
smsAppId := "1400705248"
signname := "智企易创"
mobiles := []string{"18607565510"}
templateId := "1478144"
params := []string{"666555", "5"}
requestId, status, err := SendByTencent(secretId, secretKey, smsAppId, signname, mobiles, templateId, params, "ap-beijing")
t.Log(*requestId)
if len(status) > 0 {
for _, v := range status {
t.Log(*v.SerialNo, *v.PhoneNumber, *v.Code, *v.Message, *v.Fee, *v.SessionContext, *v.IsoCode)
}
}
t.Log(err)
}