tencent

package module
v0.0.0-...-d80e93f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 12 Imported by: 0

README

go_tencent_sms

腾讯云短信

使用方法

//创建对象参数分别为:appid, appKey 和要使用的签名,签名必须事先审核通过。
Sms := tencent.NewSms(smsAppid, smsAppKey, smsSign)
//发送短信时参数为:短信模板ID、模板参数数组、接收的手机号码
err := Sms.Send(222124, []string{"352146", "10"}, "手机号码")
if err != nil {
  c.JSON(http.StatusOK, gin.H{
    "code": e.ERROR,
    "msg":  err.Error(),
  })
} else {
  c.JSON(http.StatusOK, gin.H{
    "code": 0,
  })
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSms

func NewSms(appid, appkey, sign string) *sms

func RandomStr

func RandomStr(length int) string

RandomStr 随机生成字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL