sms

package
v0.0.0-...-396ab03 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package sms provides several sms services API access.

Example:

func sendSms(param, template string, phones ...string) (bool, error) {
	a := alidayu.New(&http.Client{Timeout: 10 * time.Second})
	c := alidayu.DefaultConfig().Merge(
		alidayu.Config{AppKey: "xxxxxxxx",
			RecNum:          strings.Join(phones, ","),
			SmsFreeSignName: "xxx",
			SmsParam:        param,
			SmsTemplateCode: template,
		})
	c.Sign = a.Sign(c, []byte("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))
	j, err := a.SendSms(c)
	if err != nil {
		return false, err
	}
	return alidayu.SmsResult(j)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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