aliyun_email

package module
v0.0.0-...-cb6e7b1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2018 License: MIT Imports: 13 Imported by: 1

README

阿里云邮件推送SDK

阿里云官方未封装GO语言SDK,故开发本SDK。

说明

  1. 本SDK只负责执行请求,得到请求结果。由于请求参数错误(如传入错误的regionId导致的后端错误等等),请自行判断返回值进行处理。
  2. BatchSendEmail需要测试时请替换成您自己的TemplateName等参数。

功能

  • SingleSendEmail
  • BatchSendEmail

单元测试

  1. 配置以下环境变量
    • ACCESS_KEY_ID 阿里云accessKeyId
    • ACCESS_SECRET 阿里云accessKeySecret
    • ACCOUNT_NAME 阿里云accountName
    • FROM_ALIAS 阿里云fromAlias
  2. go test

Documentation

Index

Constants

View Source
const (
	RegionCNHangZhou   = "cn-hangzhou"
	RegionAPSouthEast1 = "ap-southeast-1"
	RegionAPSouthEast2 = "ap-southeast-2"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(accessKeyId, accessKeySecret, accountName, fromAlias, regionId string) *client

Types

type BatchRequest

type BatchRequest struct {
	AddressType   int `json:",int"`
	TemplateName  string
	ReceiversName string
	TagName       string
	ClickTrace    string
}

type Params

type Params map[string]interface{}

func (Params) Get

func (p Params) Get(key string) interface{}

func (Params) Keys

func (p Params) Keys() []string

func (Params) PutBoolean

func (p Params) PutBoolean(key string, val bool)

func (Params) PutInt

func (p Params) PutInt(key string, val int)

func (Params) PutString

func (p Params) PutString(key, val string)

func (Params) Remove

func (p Params) Remove(key string)

func (Params) Sign

func (p Params) Sign(method, accessKeySecret string)

func (Params) SortedKeys

func (p Params) SortedKeys() []string

func (Params) ToUrlValues

func (p Params) ToUrlValues() url.Values

func (Params) UrlEncode

func (p Params) UrlEncode(val string) string

type SingleRequest

type SingleRequest struct {
	ReplyToAddress bool
	AddressType    int `json:",int"`
	ToAddress      string
	Subject        string
	HtmlBody       string
	TextBody       string
	ClickTrace     string
}

Jump to

Keyboard shortcuts

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