All Products
Search
Document Center

Create a message template

Last Updated: May 25, 2021

A template consists of the body, placeholders and some other attributes. You can use placeholders to specify dynamic content in the template. Only templates with placeholders can be used to send personalized messages.

You can use templates to flexibly configure messages and eliminate input of repeated content.

In a template, you can mark the dynamic part in the title, body, and redirection URL by using the format of #Placeholder name#.

Procedure

  1. Log in to the mPaaS console, select the target app on the app list page to go to the operation page of the app.
  2. On the left-side navigation pane, choose Message Push Service.
  3. Click the Message template tab.
  4. Click Create template. The Create template dialog box appears.
  5. Configure template information. The following table describes related parameters.
    Parameter Required Description
    Name Yes The name of the template. The name must be 1 to 200 characters in length, and can contain letters, digits, and underscores (_). The name must be unique, and it will be used to identify the template in API calling.
    Description Yes The description of the template. The description must be 1 to 200 characters in length, and can contain letters, numbers, and underscores (_).
    Display type Yes The options include:
    • Show message (on notification bar): indicates that the messages will be displayed on the target device. The display style is determined by the device’s operating system and cannot be customized.
    • Silent push: indicates that the messages will not be displayed in any form on the target device.
    Display style Yes The style that how the message is displayed on the client. You can choose any one of the following three styles: Default (short text), Big text, and Rich text.
    • Default: This style is suitable for messages with concise and clear content. The message of this style contains title and text only. It is recommended to keep the length of the message text within 100 characters, including custom parameters and symbols.
    • Big text: This is style is suitable for messages with long text, such as information and news messages, so users can quickly obtain information without opening the application. The message of this style contains title and text only. It is recommended to keep the length of the message text within 256 characters, including custom parameters and symbols.
    • Rich text: This style supports the messages containing icon and image, suitable for the messages with various content. To ensure good message presentation effect, it is better to keep the text within two lines.
    Title Yes The title of the template. The title must be 1 to 200 characters in length.
    Body Yes The body of the template. The text must be 1 to 200 characters in length.
    Icon No The icon displayed on the right of the message, which can be JPG, JPEG or PNG image. Enter the public accessable URL of the icon here.
    If you only provide the default icon URL while no materials are uploaded for the corresponding third-party channels, the default icon will be automatically pulled and used for the messages pushed through the third-party channels. Since the third-party channels have different requirements on the icon material, it is suggested to upload the material for each third-party channel seperately according to their requirements.
    • Default icon: The suggested size is 140 * 140px, not exceeding 50 KB.
    • OPPO icon: The suggested size is 140 * 140px, not exceeding 50 KB.
    • Xiaomi icon: The suggested size is 120 * 120px, not exceeding 50 KB.
    • Huawei icon: The suggested size is 40 * 40dp, not exceeding 512 KB.
    • For FCM channel, if no specific requirement applies, the default icon will be automatically used.
    Large image No The image displayed at the lower part of the message, which can be JPG, JPEG or PNG image. Enter the public accessable URL of the image here.
    If you only provide the default image URL while no materials are uploaded for the corresponding third-party channels, the default large image will be automatically pulled and used for the messages pushed through the third-party channels. Since the third-party channels have different requirements on the image, it is suggested to upload the material for each third-party channel seperately according to their requirements.
    • Default image: The suggested size is 876 * 324px, not exceeding 1 MB.
    • OPPO image: The suggested size is 876 * 324px, not exceeding 1 MB.
    • Xiaomi image: The suggested size is 876 * 324px, not exceeding 1 MB.
    • iOS image: Support custom images, without limitation on image size.
    • For FCM channel, if no specific requirement applies, the default image will be automatically used.
    Action upon click Yes This parameter will be sent to the client as a reference. You need to develop the implementation logic by yourself. Valid values:
    • Open Intent Activity: A user can tap the message on their device to visit the native page.
    • Open Web URL: A user can tap the message on their device to visit a specified web page.
    URL No This parameter will be sent to the client as a reference. You need to develop the implementation logic by yourself.
    Set this parameter based on the value of Operate upon click.
    • If the value is Open Intent Activity, enter the URL of the native page to be visited (Android: ActivityName; iOS: VCName).
    • If the value is Open Web URL, enter the URL of the web page to be visited.
  6. Click Create to create a template. When the template is created successfully, the Message template page is displayed, with the new template listed at the top.