ses

package
v0.22.135 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ses include resources of ucloud ses product

See also

for detail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailedTargetEmail

type FailedTargetEmail struct {

	// 密送
	Bcc []string

	// 抄送
	Cc []string

	// 收件邮箱
	EmailAddress string

	// 失败原因
	FailureReason string

	// 模版变量
	TemplateVariableParams []string

	// 收件人
	To string
}

FailedTargetEmail - 发送失败收件人

type SESClient

type SESClient struct {
	*ucloud.Client
}

SESClient is the client of SES

func NewClient

func NewClient(config *ucloud.Config, credential *auth.Credential) *SESClient

NewClient will return a instance of SESClient

func (*SESClient) NewSendSESEmailRequest

func (c *SESClient) NewSendSESEmailRequest() *SendSESEmailRequest

NewSendSESEmailRequest will create request of SendSESEmail action.

func (*SESClient) NewSendSESEmailTemplateRequest

func (c *SESClient) NewSendSESEmailTemplateRequest() *SendSESEmailTemplateRequest

NewSendSESEmailTemplateRequest will create request of SendSESEmailTemplate action.

func (*SESClient) SendSESEmail

func (c *SESClient) SendSESEmail(req *SendSESEmailRequest) (*SendSESEmailResponse, error)

API: SendSESEmail

直接发送邮件,无需创建发送任务和模版,支持 HTML/纯文本内容、主题、抄送/密送、附件和邮件头,单次最多 100 个收件人。

func (*SESClient) SendSESEmailTemplate

func (c *SESClient) SendSESEmailTemplate(req *SendSESEmailTemplateRequest) (*SendSESEmailTemplateResponse, error)

API: SendSESEmailTemplate

通过模版发送邮件,无需创建发送任务。支持自定义主题、摘要、预览文本、抄送/密送、附件和邮件头,单次最多 100 个收件人。

type SendSESEmailParamAttachments

type SendSESEmailParamAttachments struct {

	// MIME 类型,如: application/pdf
	ContentType *string `required:"false"`

	// 附件内容(Base64 编码),单次请求最多 10 个附件;总大小不超过 10MB
	Data *string `required:"false"`

	// 附件文件名
	Filename *string `required:"false"`
}

SendSESEmailParamAttachments is request schema for complex param

type SendSESEmailParamHeaders

type SendSESEmailParamHeaders struct {

	// 邮件头名称,最多 20 个且仅允许字母、数字和 -(正则 ^[A-Za-z0-9-]+$)。禁止使用保留名称:From/To/Cc/Bcc/Subject/Reply-To/Content-Type/Mime-Version,以及 X-SES- 前缀(均不区分大小写)。
	Name *string `required:"false"`

	// 邮件头值
	Value *string `required:"false"`
}

SendSESEmailParamHeaders is request schema for complex param

type SendSESEmailRequest

type SendSESEmailRequest struct {
	request.CommonBase

	//
	Attachments []SendSESEmailParamAttachments `required:"false"`

	// 密送(抄送+密送总数量不能超过100)
	Bcc []string `required:"false"`

	// 抄送(抄送+密送总数量不能超过100)
	Cc []string `required:"false"`

	// 发件人邮箱,配置地址:https://console.ucloud.cn/ses/email-config?tab=sender-list
	From *string `required:"true"`

	// 发件人名称,不传或为空时,自动回落到该发件人在控制台配置的别名(Alias)
	FromName *string `required:"false"`

	//
	Headers []SendSESEmailParamHeaders `required:"false"`

	// HTML 内容 (与Text二选一,长度上限 10,485,760个字符)
	Html *string `required:"false"`

	// 邮件预览文本
	PreHeader *string `required:"false"`

	// 邮件主题(长度 1~200 字符)
	Subject *string `required:"true"`

	// 纯文本内容 (与Html二选一,长度上限 10,485,760个字符)
	Text *string `required:"false"`

	// 收件人
	To []string `required:"true"`
}

SendSESEmailRequest is request schema for SendSESEmail action

type SendSESEmailResponse

type SendSESEmailResponse struct {
	response.CommonBase

	// 发送失败的收件人列表
	FailContent []FailedTargetEmail

	// 本次发送任务的唯一标识
	SessionNo string

	// 发送成功数
	SuccessCount int
}

SendSESEmailResponse is response schema for SendSESEmail action

type SendSESEmailTemplateParamAttachments

type SendSESEmailTemplateParamAttachments struct {

	// MIME 类型,如: application/pdf
	ContentType *string `required:"false"`

	// 附件内容(Base64 编码),单次请求最多 10 个附件;总大小不超过 10MB
	Data *string `required:"false"`

	// 附件文件名
	Filename *string `required:"false"`
}

SendSESEmailTemplateParamAttachments is request schema for complex param

type SendSESEmailTemplateParamEmailContent

type SendSESEmailTemplateParamEmailContent struct {

	// 密送(抄送+密送总数量不能超过100)
	Bcc []string `required:"false"`

	// 抄送(抄送+密送总数量不能超过100)
	Cc []string `required:"false"`

	// 模版变量,格式 variableName{##}variableValue (例:{"name{##}Tom", "code{##}1234"})
	TemplateVariableParams []string `required:"false"`

	// 收件人,最多100条
	To *string `required:"false"`
}

SendSESEmailTemplateParamEmailContent is request schema for complex param

type SendSESEmailTemplateParamHeaders

type SendSESEmailTemplateParamHeaders struct {

	// 邮件头名称,最多 20 个且仅允许字母、数字和 -(正则 ^[A-Za-z0-9-]+$)。禁止使用保留名称:From/To/Cc/Bcc/Subject/Reply-To/Content-Type/Mime-Version,以及 X-SES- 前缀(均不区分大小写)。
	Name *string `required:"false"`

	// 邮件头值
	Value *string `required:"false"`
}

SendSESEmailTemplateParamHeaders is request schema for complex param

type SendSESEmailTemplateRequest

type SendSESEmailTemplateRequest struct {
	request.CommonBase

	//
	Attachments []SendSESEmailTemplateParamAttachments `required:"false"`

	//
	EmailContent []SendSESEmailTemplateParamEmailContent `required:"false"`

	// 发件人邮箱
	From *string `required:"true"`

	// 发件人名称,不传或为空时,自动回落到该发件人在控制台配置的别名(Alias)
	FromName *string `required:"false"`

	//
	Headers []SendSESEmailTemplateParamHeaders `required:"false"`

	// 邮件预览文本
	PreHeader *string `required:"false"`

	// 邮件主题
	Subject *string `required:"true"`

	// 模版 ID,获取:https://console.ucloud.cn/ses/email-config?tab=template
	TemplateId *string `required:"true"`
}

SendSESEmailTemplateRequest is request schema for SendSESEmailTemplate action

type SendSESEmailTemplateResponse

type SendSESEmailTemplateResponse struct {
	response.CommonBase

	// 发送失败的收件人列表
	FailContent []FailedTargetEmail

	// 本次发送任务的唯一标识
	SessionNo string

	// 发送成功数
	SuccessCount int
}

SendSESEmailTemplateResponse is response schema for SendSESEmailTemplate action

Jump to

Keyboard shortcuts

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