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#.
- Log in to the mPaaS console, select the target app on the app list page to go to the operation page of the app.
- On the left-side navigation pane, choose Message Push Service.
- Click the Message template tab.
- Click Create template. The Create template dialog box appears.
- 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 (_). 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. 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.
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.
- 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.