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
Log in to the mPaaS console, select your app, and enter the Message Push Service > Message templates page.
On the right page, click the Create template button, and in the pop-up template creation window, configure template information. The following table describes related parameters.
Parameter
Required
Description
Template 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 (_).
Template title
Yes
The title of the template. The title must be 1 ~ 200 characters in length.
Template body
Yes
The body of the template. The text must be 1 ~ 200 characters in length.
Message type: silent message
Yes
Whether to display the message:
Yes: Indicates that the message will not be displayed in any form on the target device, and user has no sense about it.
No: Indicates that the message will be displayed in the notification bar.
For Android devices, you need to perform different operations according to the push channel that you have selected:
MPS channel: This parameter is sent to the client as a reference field. You need to parse the message body and get the content of this field, then control the display of the message.
Vendor channel: This parameter is sent to the target device as a field. The device vendor's system will then parse the content of this field, and control the display of the message. You do not need to perform any other operations.
For iOS devices, the display of messages is controlled by the device vendor’s system. You do not need to perform any other operations.
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.
Icon
No
The icon displayed on the right of the message, which can be JPG, JPEG or PNG image. Enter the public accessible 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 separately 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.
FCM icon: 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 accessible 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 separately according to their requirements.
Default large image: The suggested size is 876 * 324px, not exceeding 1 MB.
OPPO large image: The suggested size is 876 * 324px, not exceeding 1 MB.
Xiaomi large image: The suggested size is 876 * 324px, not exceeding 1 MB.
iOS large image: Support custom images, without limitation on image size.
FCM large image: If no specific requirement applies, the default image will be automatically used.
Redirect upon click
Yes
This parameter is sent to the client as a reference field. You need to implement subsequent operations by referring to the field.
Web page: Users will be redirected to a Web page. It is required to enter the URL of the web page to be visited.
Custom page: Users will be redirected to a native page. It is required to enter the address of the native page to be visited (Android: ActivityName; iOS: VCName).
Redirection address
No
The page to be visited after a user taps the message on the mobile phone. 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 Redirect upon click.
Click Submit to create the template. When the template is created successfully, the Message templates page is displayed, with the new template listed at the top.