Help Center> Simple Message Notification> User Guide> Message Template Management

Message Template Management

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.

Message templates are identified by name, but you can create different templates with the same name as long as they are configured for different protocols. All template messages must include a Default template or they cannot be sent out. The Default template is used any time a template has not been configured for a given protocol, but as long as there is a template for the protocol, then any subscriber who selected that protocol when they subscribed will receive a message using the corresponding template.

This section describes how to publish messages using a template.

To Create a Message Template

  1. Log in to the management console.
  2. Click on the upper left to select the desired region and project.
  3. Under Management & Governance, select Simple Message Notification.

    The SMN console is displayed.

  4. In the navigation pane, choose Topic Management > Message Templates.
  5. In the upper right corner, click Create Message Template.

    The Create Message Template dialog box is displayed.

    Figure 1 Create Message Template
  6. 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 starts with a letter or digit.
    • Can contain 1 to 64 bytes.
    • Cannot be modified once the template is created.

    Protocol

    Endpoint protocol of the template, which cannot be changed once the template is created

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

    If you do not specify a protocol, Default is used.

    Content

    Template content

    You can use variables as placeholders. Before you send messages using the template, SMN replaces the variables with the message content you specify. A variable can contain up to 21 characters and must start with a letter or digit. It can contain letters, digits, hyphens (-), underscores (_), and periods (.).

    The message template must meet the following requirements:

    • The template supports plain text only.
    • The template content cannot be left blank and cannot exceed 256 KB.
    • A template can contain up to 90 different variables and 256 repeated variables at the same time.
    • When you send messages using a template, the message content 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.

  7. Click OK.

    The template you created is displayed in the template list.

To Modify a Template

  1. Locate the template to be modified in the template list.
  2. Click Modify under Operation to change its content.

To Delete a Template

  1. Locate the template to be deleted in the template list.
  2. Click Delete under Operation.