sms

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SmsClient = &smsClient{}
)

Functions

func GenValidateCode added in v0.1.9

func GenValidateCode(len int) string

GenValidateCode 生成随机数验证码

func Send added in v0.1.9

func Send(msg *RobotMsg) error

func SendWithCourier

func SendWithCourier()

func SendWithTextMagic

func SendWithTextMagic()

func SendWithTwilio

func SendWithTwilio(accountSid, authToken, from, to, message string) (map[string]interface{}, error)

func StartSend added in v0.1.9

func StartSend()

Types

type ActionCard added in v0.1.9

type ActionCard struct {
	Title          string `json:"title"`
	Text           string `json:"text"`
	HideAvatar     string `json:"hideAvatar"`
	BtnOrientation string `json:"btnOrientation"`
	SingleTitle    string `json:"singleTitle"`
	SingleURL      string `json:"singleURL"`
	Btns           []Btn  `json:"btns"`
}

type Btn added in v0.1.9

type Btn struct {
	Title     string `json:"title"`
	ActionURL string `json:"actionURL"`
}

type Content added in v0.1.9

type Content struct {
	Level  string `json:"level,omitempty"`
	Method string `json:"method,omitempty"`
	Msg    string `json:"msg,omitempty"`
	Svc    string `json:"svc,omitempty"`
	Code   int    `json:"code,omitempty"`
	Tid    string `json:"tid,omitempty"`
}
type Link struct {
	Title      string `json:"title"`
	Text       string `json:"text"`
	PicURL     string `json:"PicUrl"`
	MessageURL string `json:"messageUrl"`
}

type Markdown added in v0.1.9

type Markdown struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

type RobotMsg added in v0.1.9

type RobotMsg struct {
	Msgtype    string     `json:"msgtype"`
	Markdown   Markdown   `json:"markdown"`
	ActionCard ActionCard `json:"actionCard"`
	Link       Link       `json:"link"`
	At         atMobiles  `json:"at"`
	IsAtAll    bool       `json:"isAtAll"`
}

type SMSContent added in v0.1.9

type SMSContent struct {
	PhoneNumbers  string
	SignName      string
	TemplateCode  string
	TemplateParam string // JSON串
}

Jump to

Keyboard shortcuts

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