SendTemplatedEmail

Last updated: 2020-10-19 10:32:57

    1. API Description

    Domain name for API request: dms.tencentcloudapi.com.

    This API is used to send template emails.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common parameter. The value used for this API: SendTemplatedEmail.
    Version Yes String Common parameter. The value used for this API: 2020-08-19.
    Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
    FromAddress Yes String Sender address.
    ToAddress Yes String Recipient address. Up to 100 recipient addresses are supported. Multiple addresses should be separated by semicolons (;).
    TemplateName Yes String The name of the template created in advance.
    TemplateValue Yes String Template variable value, which is a JSON string.
    FromName No String Sender name.
    ReplyAddress No String Reply-to address.

    3. Output Parameters

    Parameter Name Type Description
    Result Boolean The result of creating a template email task
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Sending template emails

    Input Example

    https://dms.tencentcloudapi.com/?Action=SendTemplatedEmail
    &FromAddress=test@example.com
    &ToAddress=to@example.com
    &TemplateName=templateName1
    &TemplateValue=templateValue1
    &<Common request parameters>

    Output Example

    {
      "result": true
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError.InternalCOSError COS exception.
    InternalError.InternalDBError Database service exception.
    InternalError.InternalEncryptError Encryption service exception.
    InvalidParameter.InvalidFromNameMalformed Format of the sender name is incorrect.
    InvalidParameter.InvalidHtmlContentMalformed Format of the HTML email body is incorrect.
    InvalidParameter.InvalidMailAddressNameMalformed Format of the email address is incorrect.
    InvalidParameter.InvalidMailContentMalformed Format of the email body is incorrect.
    InvalidParameter.InvalidReceiverNameMalformed Format of the recipient address is incorrect.
    InvalidParameter.InvalidSubjectMalformed Format of the summary is incorrect.
    InvalidParameter.InvalidTaskNameMalformed Format of the email task name is incorrect.
    InvalidParameter.InvalidTemplateContentMalformed Format of the email body set in the template is incorrect.
    InvalidParameter.InvalidTemplateNameMalformed Format of the template name is incorrect.
    InvalidParameter.InvalidTemplateValueMalformed Format of the template variable values is incorrect.
    InvalidParameter.InvalidTextContentMalformed Format of the plain-text email body is incorrect.
    ResourceInUse.InvalidTaskNameDuplicate The email task name already exists.
    ResourceNotFound.InvalidMailAddressNotFound The email address does not exist.
    ResourceNotFound.InvalidReceiverNotFound The recipient address does not exist.
    ResourceNotFound.InvalidReplyNotFound The reply-to address does not exist.
    ResourceNotFound.InvalidTaskNameNotFound The email task does not exist.
    ResourceNotFound.InvalidTemplateNotFound The template does not exist.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help