短信发送方法
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.

20 lines
535 B

package sms
import (
"testing"
)
func Test_SendByALiYun(t *testing.T) {
accessKeyId := "LTAI5tCxxykQfnZtmYD8tm2x"
accessKeySecret := "RgbY2Z9ciVc3ljXPr6OXw1ycn3rCIu"
signName := "鄱阳湖生态科技城"
phoneNumbers := "13790717280"
templateCode := "SMS_224500006"
params := make(map[string]string, 0)
params["code"] = "今晚打球吗"
TemplateParam, _ := json.Marshal(params)
ret, err := SendByALiYun(accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, string(TemplateParam))
t.Log(ret)
t.Log(err)
}