Contact Us
Log In

Add Email Template

Last Updated on : 2021-08-10 13:44:24download

Add email templates based on the template name, title, content, and other information.

API address

POST: /v1.0/iot-03/msg-templates/mails

Request parameter

Description of body

Parameter name Type IN Required Description
name String true The template name with 1 to 30 characters.
title String true The template title with 1 to 50 characters.
sender_name String true The sender name with 1 to 30 characters. For example, set the sender to Jack, and the sender’s email address to test@example.com. The receiver will see the sender’s address as “Jack” test@example.com.
content String true The template content in the format of HTML and text. The maximum capacity is 28 KB.
type Integer true The email type. Valid values:
  • 0: verification code.
  • 1: email notification.
  • 2: promotional email.
remark String true The remarks of the application for the email template. Describe your application scenario with 1 to 100 characters.

Return parameter

Parameter name Type Description
result MsgTemplatesRes

Description of result

Parameter name Type Description
template_id String The template ID. The returned template ID will not take effect until it is approved. Please wait patiently for the result of the review.

Request example

POST: /v1.0/iot-03/msg-templates/mails
{ "name": "Template of Email Verification Code", "sender_name": "Jack", "title": "Verification Code", "content": "You are registering with your email address. The verification code is: ${code}, valid for 5 minutes.", "type": 0, "remark": "The current email template applies to the registration scenario." }

Return example

{ "result": { "template_id": "MAIL_1616396456" }, "t": 1586153261345, "success": true }

Error code

For more information, see error code.

Email template:

Below are the public templates we provide, and they are the quick start tools for all developers. By default, all developers who subscribe to the email service have access to the public templates, and simply use the public templates by inputting the template ID from the table below when sending emails.

Template ID Message Type Title Message Content
MAIL_1624531323 Verification Verification Code Below is your verification code ${code}. For your account security, please do not share this code with others.
MAIL_1624531338 Verification Password Retrieval You have submitted a request for password retrieval, and the verification code is ${code}. For the security of your account, please do not share this verification code with others.