Skip to content

sms-server could send a custom length verification code

License

Notifications You must be signed in to change notification settings

my-petrichor/go-sms-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ❤️ ⭐ ✨ 💫

About

sms-server could send a custom length verification code

Topics

Resources

License

Stars

Watchers

Forks

Languages