Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) SendEmail(request *SendEmailRequest) (response *SendEmailResponse, err error)
- func (c *Client) SendEmailWithContext(ctx context.Context, request *SendEmailRequest) (response *SendEmailResponse, err error)
- func (c *Client) SendTemplatedEmail(request *SendTemplatedEmailRequest) (response *SendTemplatedEmailResponse, err error)
- func (c *Client) SendTemplatedEmailWithContext(ctx context.Context, request *SendTemplatedEmailRequest) (response *SendTemplatedEmailResponse, err error)
- type SendEmailRequest
- type SendEmailRequestParams
- type SendEmailResponse
- type SendEmailResponseParams
- type SendTemplatedEmailRequest
- type SendTemplatedEmailRequestParams
- type SendTemplatedEmailResponse
- type SendTemplatedEmailResponseParams
Constants ¶
const ( // COS exception. INTERNALERROR_INTERNALCOSERROR = "InternalError.InternalCOSError" // Database service exception. INTERNALERROR_INTERNALDBERROR = "InternalError.InternalDBError" // Encryption service exception. INTERNALERROR_INTERNALENCRYPTERROR = "InternalError.InternalEncryptError" // Format of the sender name is incorrect. INVALIDPARAMETER_INVALIDFROMNAMEMALFORMED = "InvalidParameter.InvalidFromNameMalformed" // Format of the HTML email body is incorrect. INVALIDPARAMETER_INVALIDHTMLCONTENTMALFORMED = "InvalidParameter.InvalidHtmlContentMalformed" // Format of the email address is incorrect. INVALIDPARAMETER_INVALIDMAILADDRESSNAMEMALFORMED = "InvalidParameter.InvalidMailAddressNameMalformed" // Format of the email body is incorrect. INVALIDPARAMETER_INVALIDMAILCONTENTMALFORMED = "InvalidParameter.InvalidMailContentMalformed" // Format of the recipient address is incorrect. INVALIDPARAMETER_INVALIDRECEIVERNAMEMALFORMED = "InvalidParameter.InvalidReceiverNameMalformed" // Format of the summary is incorrect. INVALIDPARAMETER_INVALIDSUBJECTMALFORMED = "InvalidParameter.InvalidSubjectMalformed" // Format of the email task name is incorrect. INVALIDPARAMETER_INVALIDTASKNAMEMALFORMED = "InvalidParameter.InvalidTaskNameMalformed" // Format of the email body set in the template is incorrect. INVALIDPARAMETER_INVALIDTEMPLATECONTENTMALFORMED = "InvalidParameter.InvalidTemplateContentMalformed" // Format of the template name is incorrect. INVALIDPARAMETER_INVALIDTEMPLATENAMEMALFORMED = "InvalidParameter.InvalidTemplateNameMalformed" // Format of the template variable values is incorrect. INVALIDPARAMETER_INVALIDTEMPLATEVALUEMALFORMED = "InvalidParameter.InvalidTemplateValueMalformed" // Format of the plain-text email body is incorrect. INVALIDPARAMETER_INVALIDTEXTCONTENTMALFORMED = "InvalidParameter.InvalidTextContentMalformed" // The email task name already exists. RESOURCEINUSE_INVALIDTASKNAMEDUPLICATE = "ResourceInUse.InvalidTaskNameDuplicate" // The email address does not exist. RESOURCENOTFOUND_INVALIDMAILADDRESSNOTFOUND = "ResourceNotFound.InvalidMailAddressNotFound" // The recipient address does not exist. RESOURCENOTFOUND_INVALIDRECEIVERNOTFOUND = "ResourceNotFound.InvalidReceiverNotFound" // The reply-to address does not exist. RESOURCENOTFOUND_INVALIDREPLYNOTFOUND = "ResourceNotFound.InvalidReplyNotFound" // The email task does not exist. RESOURCENOTFOUND_INVALIDTASKNAMENOTFOUND = "ResourceNotFound.InvalidTaskNameNotFound" // The template does not exist. RESOURCENOTFOUND_INVALIDTEMPLATENOTFOUND = "ResourceNotFound.InvalidTemplateNotFound" )
const APIVersion = "2020-08-19"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) SendEmail ¶
func (c *Client) SendEmail(request *SendEmailRequest) (response *SendEmailResponse, err error)
SendEmail This API is used to send regular emails.
error code that may be returned:
INTERNALERROR_INTERNALCOSERROR = "InternalError.InternalCOSError" INTERNALERROR_INTERNALDBERROR = "InternalError.InternalDBError" INTERNALERROR_INTERNALENCRYPTERROR = "InternalError.InternalEncryptError" INVALIDPARAMETER_INVALIDFROMNAMEMALFORMED = "InvalidParameter.InvalidFromNameMalformed" INVALIDPARAMETER_INVALIDHTMLCONTENTMALFORMED = "InvalidParameter.InvalidHtmlContentMalformed" INVALIDPARAMETER_INVALIDMAILADDRESSNAMEMALFORMED = "InvalidParameter.InvalidMailAddressNameMalformed" INVALIDPARAMETER_INVALIDMAILCONTENTMALFORMED = "InvalidParameter.InvalidMailContentMalformed" INVALIDPARAMETER_INVALIDRECEIVERNAMEMALFORMED = "InvalidParameter.InvalidReceiverNameMalformed" INVALIDPARAMETER_INVALIDSUBJECTMALFORMED = "InvalidParameter.InvalidSubjectMalformed" INVALIDPARAMETER_INVALIDTASKNAMEMALFORMED = "InvalidParameter.InvalidTaskNameMalformed" INVALIDPARAMETER_INVALIDTEXTCONTENTMALFORMED = "InvalidParameter.InvalidTextContentMalformed" RESOURCEINUSE_INVALIDTASKNAMEDUPLICATE = "ResourceInUse.InvalidTaskNameDuplicate" RESOURCENOTFOUND_INVALIDMAILADDRESSNOTFOUND = "ResourceNotFound.InvalidMailAddressNotFound" RESOURCENOTFOUND_INVALIDRECEIVERNOTFOUND = "ResourceNotFound.InvalidReceiverNotFound" RESOURCENOTFOUND_INVALIDREPLYNOTFOUND = "ResourceNotFound.InvalidReplyNotFound" RESOURCENOTFOUND_INVALIDTASKNAMENOTFOUND = "ResourceNotFound.InvalidTaskNameNotFound"
func (*Client) SendEmailWithContext ¶
func (c *Client) SendEmailWithContext(ctx context.Context, request *SendEmailRequest) (response *SendEmailResponse, err error)
SendEmail This API is used to send regular emails.
error code that may be returned:
INTERNALERROR_INTERNALCOSERROR = "InternalError.InternalCOSError" INTERNALERROR_INTERNALDBERROR = "InternalError.InternalDBError" INTERNALERROR_INTERNALENCRYPTERROR = "InternalError.InternalEncryptError" INVALIDPARAMETER_INVALIDFROMNAMEMALFORMED = "InvalidParameter.InvalidFromNameMalformed" INVALIDPARAMETER_INVALIDHTMLCONTENTMALFORMED = "InvalidParameter.InvalidHtmlContentMalformed" INVALIDPARAMETER_INVALIDMAILADDRESSNAMEMALFORMED = "InvalidParameter.InvalidMailAddressNameMalformed" INVALIDPARAMETER_INVALIDMAILCONTENTMALFORMED = "InvalidParameter.InvalidMailContentMalformed" INVALIDPARAMETER_INVALIDRECEIVERNAMEMALFORMED = "InvalidParameter.InvalidReceiverNameMalformed" INVALIDPARAMETER_INVALIDSUBJECTMALFORMED = "InvalidParameter.InvalidSubjectMalformed" INVALIDPARAMETER_INVALIDTASKNAMEMALFORMED = "InvalidParameter.InvalidTaskNameMalformed" INVALIDPARAMETER_INVALIDTEXTCONTENTMALFORMED = "InvalidParameter.InvalidTextContentMalformed" RESOURCEINUSE_INVALIDTASKNAMEDUPLICATE = "ResourceInUse.InvalidTaskNameDuplicate" RESOURCENOTFOUND_INVALIDMAILADDRESSNOTFOUND = "ResourceNotFound.InvalidMailAddressNotFound" RESOURCENOTFOUND_INVALIDRECEIVERNOTFOUND = "ResourceNotFound.InvalidReceiverNotFound" RESOURCENOTFOUND_INVALIDREPLYNOTFOUND = "ResourceNotFound.InvalidReplyNotFound" RESOURCENOTFOUND_INVALIDTASKNAMENOTFOUND = "ResourceNotFound.InvalidTaskNameNotFound"
func (*Client) SendTemplatedEmail ¶
func (c *Client) SendTemplatedEmail(request *SendTemplatedEmailRequest) (response *SendTemplatedEmailResponse, err error)
SendTemplatedEmail This API is used to send template emails.
error code that may be returned:
INTERNALERROR_INTERNALCOSERROR = "InternalError.InternalCOSError" INTERNALERROR_INTERNALDBERROR = "InternalError.InternalDBError" INTERNALERROR_INTERNALENCRYPTERROR = "InternalError.InternalEncryptError" INVALIDPARAMETER_INVALIDFROMNAMEMALFORMED = "InvalidParameter.InvalidFromNameMalformed" INVALIDPARAMETER_INVALIDHTMLCONTENTMALFORMED = "InvalidParameter.InvalidHtmlContentMalformed" INVALIDPARAMETER_INVALIDMAILADDRESSNAMEMALFORMED = "InvalidParameter.InvalidMailAddressNameMalformed" INVALIDPARAMETER_INVALIDMAILCONTENTMALFORMED = "InvalidParameter.InvalidMailContentMalformed" INVALIDPARAMETER_INVALIDRECEIVERNAMEMALFORMED = "InvalidParameter.InvalidReceiverNameMalformed" INVALIDPARAMETER_INVALIDSUBJECTMALFORMED = "InvalidParameter.InvalidSubjectMalformed" INVALIDPARAMETER_INVALIDTASKNAMEMALFORMED = "InvalidParameter.InvalidTaskNameMalformed" INVALIDPARAMETER_INVALIDTEMPLATECONTENTMALFORMED = "InvalidParameter.InvalidTemplateContentMalformed" INVALIDPARAMETER_INVALIDTEMPLATENAMEMALFORMED = "InvalidParameter.InvalidTemplateNameMalformed" INVALIDPARAMETER_INVALIDTEMPLATEVALUEMALFORMED = "InvalidParameter.InvalidTemplateValueMalformed" INVALIDPARAMETER_INVALIDTEXTCONTENTMALFORMED = "InvalidParameter.InvalidTextContentMalformed" RESOURCEINUSE_INVALIDTASKNAMEDUPLICATE = "ResourceInUse.InvalidTaskNameDuplicate" RESOURCENOTFOUND_INVALIDMAILADDRESSNOTFOUND = "ResourceNotFound.InvalidMailAddressNotFound" RESOURCENOTFOUND_INVALIDRECEIVERNOTFOUND = "ResourceNotFound.InvalidReceiverNotFound" RESOURCENOTFOUND_INVALIDREPLYNOTFOUND = "ResourceNotFound.InvalidReplyNotFound" RESOURCENOTFOUND_INVALIDTASKNAMENOTFOUND = "ResourceNotFound.InvalidTaskNameNotFound" RESOURCENOTFOUND_INVALIDTEMPLATENOTFOUND = "ResourceNotFound.InvalidTemplateNotFound"
func (*Client) SendTemplatedEmailWithContext ¶
func (c *Client) SendTemplatedEmailWithContext(ctx context.Context, request *SendTemplatedEmailRequest) (response *SendTemplatedEmailResponse, err error)
SendTemplatedEmail This API is used to send template emails.
error code that may be returned:
INTERNALERROR_INTERNALCOSERROR = "InternalError.InternalCOSError" INTERNALERROR_INTERNALDBERROR = "InternalError.InternalDBError" INTERNALERROR_INTERNALENCRYPTERROR = "InternalError.InternalEncryptError" INVALIDPARAMETER_INVALIDFROMNAMEMALFORMED = "InvalidParameter.InvalidFromNameMalformed" INVALIDPARAMETER_INVALIDHTMLCONTENTMALFORMED = "InvalidParameter.InvalidHtmlContentMalformed" INVALIDPARAMETER_INVALIDMAILADDRESSNAMEMALFORMED = "InvalidParameter.InvalidMailAddressNameMalformed" INVALIDPARAMETER_INVALIDMAILCONTENTMALFORMED = "InvalidParameter.InvalidMailContentMalformed" INVALIDPARAMETER_INVALIDRECEIVERNAMEMALFORMED = "InvalidParameter.InvalidReceiverNameMalformed" INVALIDPARAMETER_INVALIDSUBJECTMALFORMED = "InvalidParameter.InvalidSubjectMalformed" INVALIDPARAMETER_INVALIDTASKNAMEMALFORMED = "InvalidParameter.InvalidTaskNameMalformed" INVALIDPARAMETER_INVALIDTEMPLATECONTENTMALFORMED = "InvalidParameter.InvalidTemplateContentMalformed" INVALIDPARAMETER_INVALIDTEMPLATENAMEMALFORMED = "InvalidParameter.InvalidTemplateNameMalformed" INVALIDPARAMETER_INVALIDTEMPLATEVALUEMALFORMED = "InvalidParameter.InvalidTemplateValueMalformed" INVALIDPARAMETER_INVALIDTEXTCONTENTMALFORMED = "InvalidParameter.InvalidTextContentMalformed" RESOURCEINUSE_INVALIDTASKNAMEDUPLICATE = "ResourceInUse.InvalidTaskNameDuplicate" RESOURCENOTFOUND_INVALIDMAILADDRESSNOTFOUND = "ResourceNotFound.InvalidMailAddressNotFound" RESOURCENOTFOUND_INVALIDRECEIVERNOTFOUND = "ResourceNotFound.InvalidReceiverNotFound" RESOURCENOTFOUND_INVALIDREPLYNOTFOUND = "ResourceNotFound.InvalidReplyNotFound" RESOURCENOTFOUND_INVALIDTASKNAMENOTFOUND = "ResourceNotFound.InvalidTaskNameNotFound" RESOURCENOTFOUND_INVALIDTEMPLATENOTFOUND = "ResourceNotFound.InvalidTemplateNotFound"
type SendEmailRequest ¶
type SendEmailRequest struct { *tchttp.BaseRequest // Sender FromAddress *string `json:"FromAddress,omitnil" name:"FromAddress"` // Recipient ToAddress *string `json:"ToAddress,omitnil" name:"ToAddress"` // Email summary Subject *string `json:"Subject,omitnil" name:"Subject"` // Sender name FromName *string `json:"FromName,omitnil" name:"FromName"` // Reply-to address ReplyAddress *string `json:"ReplyAddress,omitnil" name:"ReplyAddress"` // The body of an HTML email HtmlContent *string `json:"HtmlContent,omitnil" name:"HtmlContent"` // The body of a plain-text email TextContent *string `json:"TextContent,omitnil" name:"TextContent"` }
func NewSendEmailRequest ¶
func NewSendEmailRequest() (request *SendEmailRequest)
func (*SendEmailRequest) FromJsonString ¶
func (r *SendEmailRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*SendEmailRequest) ToJsonString ¶
func (r *SendEmailRequest) ToJsonString() string
type SendEmailRequestParams ¶
type SendEmailRequestParams struct { // Sender FromAddress *string `json:"FromAddress,omitnil" name:"FromAddress"` // Recipient ToAddress *string `json:"ToAddress,omitnil" name:"ToAddress"` // Email summary Subject *string `json:"Subject,omitnil" name:"Subject"` // Sender name FromName *string `json:"FromName,omitnil" name:"FromName"` // Reply-to address ReplyAddress *string `json:"ReplyAddress,omitnil" name:"ReplyAddress"` // The body of an HTML email HtmlContent *string `json:"HtmlContent,omitnil" name:"HtmlContent"` // The body of a plain-text email TextContent *string `json:"TextContent,omitnil" name:"TextContent"` }
Predefined struct for user
type SendEmailResponse ¶
type SendEmailResponse struct { *tchttp.BaseResponse Response *SendEmailResponseParams `json:"Response"` }
func NewSendEmailResponse ¶
func NewSendEmailResponse() (response *SendEmailResponse)
func (*SendEmailResponse) FromJsonString ¶
func (r *SendEmailResponse) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*SendEmailResponse) ToJsonString ¶
func (r *SendEmailResponse) ToJsonString() string
type SendEmailResponseParams ¶
type SendEmailResponseParams struct { // The result of creating an email task Result *bool `json:"Result,omitnil" name:"Result"` // The unique request ID, which is returned for each request. RequestId is required for locating a problem. RequestId *string `json:"RequestId,omitnil" name:"RequestId"` }
Predefined struct for user
type SendTemplatedEmailRequest ¶
type SendTemplatedEmailRequest struct { *tchttp.BaseRequest // Sender address. FromAddress *string `json:"FromAddress,omitnil" name:"FromAddress"` // Recipient address. Up to 100 recipient addresses are supported. Multiple addresses should be separated by semicolons (;). ToAddress *string `json:"ToAddress,omitnil" name:"ToAddress"` // The name of the template created in advance. TemplateName *string `json:"TemplateName,omitnil" name:"TemplateName"` // Template variable value, which is a JSON string. TemplateValue *string `json:"TemplateValue,omitnil" name:"TemplateValue"` // Sender name. FromName *string `json:"FromName,omitnil" name:"FromName"` // Reply-to address. ReplyAddress *string `json:"ReplyAddress,omitnil" name:"ReplyAddress"` }
func NewSendTemplatedEmailRequest ¶
func NewSendTemplatedEmailRequest() (request *SendTemplatedEmailRequest)
func (*SendTemplatedEmailRequest) FromJsonString ¶
func (r *SendTemplatedEmailRequest) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*SendTemplatedEmailRequest) ToJsonString ¶
func (r *SendTemplatedEmailRequest) ToJsonString() string
type SendTemplatedEmailRequestParams ¶
type SendTemplatedEmailRequestParams struct { // Sender address. FromAddress *string `json:"FromAddress,omitnil" name:"FromAddress"` // Recipient address. Up to 100 recipient addresses are supported. Multiple addresses should be separated by semicolons (;). ToAddress *string `json:"ToAddress,omitnil" name:"ToAddress"` // The name of the template created in advance. TemplateName *string `json:"TemplateName,omitnil" name:"TemplateName"` // Template variable value, which is a JSON string. TemplateValue *string `json:"TemplateValue,omitnil" name:"TemplateValue"` // Sender name. FromName *string `json:"FromName,omitnil" name:"FromName"` // Reply-to address. ReplyAddress *string `json:"ReplyAddress,omitnil" name:"ReplyAddress"` }
Predefined struct for user
type SendTemplatedEmailResponse ¶
type SendTemplatedEmailResponse struct { *tchttp.BaseResponse Response *SendTemplatedEmailResponseParams `json:"Response"` }
func NewSendTemplatedEmailResponse ¶
func NewSendTemplatedEmailResponse() (response *SendTemplatedEmailResponse)
func (*SendTemplatedEmailResponse) FromJsonString ¶
func (r *SendTemplatedEmailResponse) FromJsonString(s string) error
FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check
func (*SendTemplatedEmailResponse) ToJsonString ¶
func (r *SendTemplatedEmailResponse) ToJsonString() string
type SendTemplatedEmailResponseParams ¶
type SendTemplatedEmailResponseParams struct { // The result of creating a template email task Result *bool `json:"Result,omitnil" name:"Result"` // The unique request ID, which is returned for each request. RequestId is required for locating a problem. RequestId *string `json:"RequestId,omitnil" name:"RequestId"` }
Predefined struct for user