Updated on 2026-07-08 GMT+08:00

Creating a Message Template

Scenarios

Message templates contain fixed and changeable content and can be used to create and send messages more quickly. When you use a template to publish a message, you can specify values for different variables in the template.

This section describes how to create a message template on the management console.

Procedure

  1. Log in to the SMN console.
  2. In the navigation pane on the left, choose Topic Management > Message Templates.
  3. On the Message Templates page, click Create Message Template.

    The Create Message Template dialog box appears.

    Figure 1 Creating a message template
  4. Specify the template name, protocol, and content.
    Table 1 Parameters required for creating a message template

    Parameter

    Description

    Template Name

    Template name, which:

    • Contains only letters, digits, hyphens (-), and underscores (_) and must start with a letter or digit.
    • Can contain 1 to 64 characters.
    • Cannot be modified once it is created.

    Protocol

    Endpoint protocol. It cannot be changed once the template is created.

    The protocol can be Default, SMS, Email, HTTP, HTTPS, or FunctionGraph (function).

    The default protocol is Default. You can select other protocols for the same template as needed.

    Each template must include the Default protocol.

    Content

    Template content.

    Use {xxx} as the placeholder to create a template. When you use this template to publish messages, replace {xxx} with specific content. xxx must start with a letter or digit and can contain up to 21 characters, including only letters, digits, hyphens (-), periods (.), and underscores (_).

    The template content must meet the following requirements:

    • The template content supports plain text only.
    • The template content cannot be empty.
    • The size of the template content cannot exceed 256 KB.
    • The template can contain up to 256 variables in total, but that includes redundant variables. For unique variables, there can be no more than 90.
    • When you publish messages using a template, the value you specify for each variable cannot exceed 1 KB.
    For example, the template information is as follows:
    • Template Name: tem_001
    • Protocol: Default
    • Content: The Arts and Crafts Exposition will be held from {startdate} through {enddate}. We sincerely invite you to join us.
    Figure 2 Creating a message template
  5. Click OK.

    The template you created is displayed in the template list.