Create and Configure a Message Template
- Sign in to the Developer Console.
- Click App Development, select Third-party enterprise app, and create a mini program or an H5 micro app.
- On the app details page, click Message Push. In the message template management area, click Add.
- Select a template type and click Create.
- Configure the message template and click Save. Important If template parameters are configured in the template, they are automatically loaded below, and you can then configure the description of each dynamic parameter. Some values in the message content change dynamically, such as order numbers, phone numbers, and product names. These values cannot be determined when you set up the template, so you can use template parameters to substitute them.
- Click Test, then click Send Test Message to verify that the message template is configured correctly.
Configure a Markdown Template
A Markdown template uses Markdown syntax to configure and send messages. It applies to pure notification messages that require no action. With a Markdown template, you can easily support display formats such as text, images, and links. Markdown Message Template Configuration
Markdown Syntax:
ActionCard Template
An ActionCard template sends messages of the ActionCard message type. It supports messages that combine message content with action points, and applies to scenarios where one or more action points in the message are required for quick handling. Based on the Markdown template, the ActionCard template supports both overall redirect and independent redirect styles. ActionCard Template ConfigurationForm Template
A Form template sends messages based on the OA message type. It applies to displaying messages such as orders, and supports redirecting to view message details. Form Message Template ConfigurationConfigure Template Parameters
Some values in the message content change dynamically, such as order numbers, phone numbers, and product names. These values cannot be determined when you set up the template, so you can use template parameters to substitute them. Pass in the actual values to replace the template parameters when you send Work Notifications. Template parameters are optional and can be configured based on your needs. Format of Template Parameters Template parameters use the format${parameter name}. Parameters must comply with the following specifications.
- Must start with a letter or an underscore.
- The remaining part can consist of letters, underscores, and numbers.
- Do not set too many dynamic parameters for a single message. No more than 5 is recommended.
${product} is a template parameter with the parameter name product. Simply pass in the value of this parameter when sending the message. For example, pass in product as “Disposable Masks” when sending the message. Then “Disposable Masks” replaces the ${product} template parameter, and the message content the user finally receives is as follows:
- DEPARTMENT_ID is the numeric department ID.
- USERID is the user’s user ID.
- Replace with the department name corresponding to the department ID “100”, such as “DingTalk Open Platform”.
- Replace with the user name corresponding to the user ID “zhangsan01”, such as “John”.