Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Development of Go language for short message Service

Shulou Source: shulou.com Published: 2022-06-03 05:24:35 11月24日 Update

SMS Go Language Development

Alibaba Cloud-Cloud Communication-SMS service is adopted. The original Alibaba brand has been upgraded to "Alibaba Cloud Communication."

use

User registration, password recovery, user authentication, Captcha login, etc.

instructions for use

Replace accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, templateParam with yours and you can use it directly.

package main

import (

"fmt"

"github.com/KenmyZhang/aliyun-communicate/app"

)

var (

gatewayUrl = "http://dysmsapi.aliyuncs.com/"

accessKeyId = "*******"

accessKeySecret = "*************"

phoneNumbers = "1354*********"

signName = "KenmyZhang"

templateCode = "SMS_82045083"

templateParam = "{\"code\":\"1234\"}"

)

func main() {

smsClient := app.NewSmsClient(gatewayUrl)

if result, err := smsClient.Execute(accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, templateParam); err != nil {

fmt.Println("error:%v", err.Error())

} else {

for key, value := range result {

fmt.Println("key:%v", key, " value:",value)

}

}

}

Code archived at: github.com/KenmyZhang/aliyun-communicate

Tags: Ali SMS SMS service user communication authentication language development code usage brand password user registration purpose identity upgrade login Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Information vpn Redmi Huawei