/go-sms-server

sms-server could send a custom length verification code

Primary LanguageGoMIT LicenseMIT

sms-server

Go Report Card

sms-server could send a custom length verification code

Table of Contents

smsProvider

tianYan

https://market.aliyun.com/products/57000002/cmapi00039249.html 测试模板: M09DD535F4

dingXin

https://market.aliyun.com/products/56928004/cmapi023305.html 测试模板: TP1711063

Usage

1.select smsProvider 选择短信 API 服务商,目前支持 tianyandingxin,记录供应商名称(全部小写),之后会用到

2.进入云市场购买产品,购买完之后申请模板,记录 templateCode 和 appCode, eg:

联系客服申请模板,获得 templateCode

记录 appCode

3.调用 API

client := api.NewClient([smsProvider], [appCode], [templateCode])
err := client.Send([phone_number], 6)
if err != nil {
	log.Println(err)
}

succeed

API

To see how the specification has been applied, see the API directory.

Example

To see how the specification has been applied, see the Examples directory.

package main

import (
	"log"

	"github.com/my-Sakura/go-sms-server/api"
)

func main() {
	client := api.NewClient("tianyan", [appCode], "M09DD535F4")
	err := client.Send([phone_number], 6)
	if err != nil {
		log.Println(err)
	}
}

License

MIT © my-Sakura ❤️ ⭐ ✨ 💫