> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Message Templates

> This article describes how to create, delete, enable, disable, clone, test, and configure message templates.

## Create and Configure a Message Template

1. Sign in to the [Developer Console](https://open-dev.dingtalk.com/?version=5.86.5#/appMgr/provider/eapp/57406/2).
2. Click **App Development**, select **Third-party enterprise app**, and create a mini program or an H5 micro app.
3. On the app details page, click **Message Push**. In the message template management area, click **Add**.
4. Select a template type and click **Create**.
5. 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.
6. 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**

| Configuration       | Supports Template Parameters | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Template Name**   | No                           | Specifies the template name.  Name it based on the template's use case and type, for example: New Ticket Notification Template.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Use Case**        | No                           | Describes the use case of the template.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Image**           | No                           | The image in the message. Supports an image link or a media\_id format.  This configuration item is set separately, and each message supports only one image. The image is pinned to the top.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Message Title**   | No                           | The message title and the content displayed on the first screen of the chat.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Message Content** | Yes                          | The message content in Markdown format. A maximum of 1,000 characters is recommended. For supported Markdown syntax, see the table below.  **Important**     - The Markdown syntax of message templates does not support headings. That is, the "# +heading text" heading format is not supported. Enter the message title separately in the title input box. Only first-level titles are supported. - The Markdown syntax of message templates does not support images. That is, the "" format is not supported. Enter the message image separately in the image input box. Each message supports only one image. |

**Markdown Syntax**:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Quote
> A man who stands for nothing will fall for anything.
 
Bold and Italic
**bold**
*italic*
 
Link
[this is a link](http://name.com)
 
Bulleted List
- item1
- item2
 
Numbered List
1. item1
2. item2

Line Break
 A line break shown in the input box is sufficient. \n is not supported.
```

## 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 Configuration**

| Configuration          | Supports Template Parameters | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Template Name**      | No                           | Specifies the template name.  Name it based on the template's use case and type, for example: New Ticket Notification Template.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Use Case**           | No                           | Describes the use case of the template.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Image**              | No                           | The image in the message. Supports an image link or a media\_id format. This configuration item is set separately, and each message supports only one image.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Message Title**      | No                           | The message title and the text displayed in the chat list and notifications. A maximum of 64 characters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Message Content**    | Yes                          | The message content in Markdown format. A maximum of 1,000 characters is recommended. For supported Markdown syntax, see the table below.  **Important**     - The Markdown syntax of message templates does not support headings. That is, the "# +heading text" heading format is not supported. Enter the message title separately in the **Title** input box. Only first-level titles are supported. - The Markdown syntax of message templates does not support images. That is, the "" format is not supported. Enter the message image separately in the **Image** input box. Each message supports only one image. |
| **Action Point**       | Yes                          | Card messages support both the overall redirect ActionCard style and the independent redirect ActionCard style:   - The overall redirect ActionCard style supports a single click action. Passing in one configuration results in the overall redirect style. - The independent redirect ActionCard style supports multiple click actions. Passing in multiple configurations results in the independent redirect style.                                                                                                                                                                                                   |
| **Action Point Link**  | Yes                          | The link address to which the message redirects when clicked. When the message is sent as a mini program, it supports mini program redirect links. A maximum of 500 characters.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Action Point Title** | Yes                          | The title of the redirect button. A maximum of 20 characters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

## Form 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 Configuration**

| Configuration                           | Supports Template Parameters   | Description                                                                                                                                                                                           |
| --------------------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Template Name**                       | No                             | Specifies the template name.  Name it based on the template's use case and type, for example: New Ticket Notification Template.                                                                       |
| **Use Case**                            | No                             | Describes the use case of the template.                                                                                                                                                               |
| **Message Box Header Content**          | Yes                            | The header title of the message. A maximum of 10 characters.  It is valid when sent to a regular chat. When sent to an organization chat, it is replaced by the name of the micro app.                |
| **Message Box Header Background Color** | Yes                            | The background color of the message header. A maximum of 8 English characters, where the first 2 indicate transparency and the last 6 indicate the color value. Do not add 0x.  For example: FFBBBBBB |
| **Message Title**                       | No                             | The title of the message body. A maximum of 50 characters is recommended.                                                                                                                             |
| **Message Content**                     | Yes                            | The content of the message body. A maximum of 3 lines is displayed.                                                                                                                                   |
| **Image in Message Body**               | No                             | The image in the message. Supports an image link or a media\_id format. This configuration item is set separately, and each message supports only one image.                                          |
| **Form Content**                        | Yes (title and variable value) | The form of the message body. A maximum of 6 items is displayed. The left and right input boxes represent the keyword of the message body and its corresponding value, respectively.                  |
| **Mobile Link**                         | Yes                            | The link address to which the message redirects when clicked. When the message is sent as a mini program, it supports mini program redirect links.                                                    |
| **PC Link**                             | Yes                            | The address to which the message redirects when clicked on a PC.                                                                                                                                      |

## Configure 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.

For example, the message content is as follows:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
The product ${product} you are following is now in stock. Grab it while you can!
```

Here, `${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:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
The product Disposable Masks you are following is now in stock. Grab it while you can!
```

A message template can have several template parameters configured, or no template parameters at all. Set them based on your actual needs.

**ID Translation**

When passing in dynamic parameters, ID translation is supported. Currently, it supports converting a department ID to a department name and converting a userId to a user name.

The ID translation syntax is as follows:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
$departmentName=DEPARTMENT_ID$
$userName=USERID$
```

Here:

* DEPARTMENT\_ID is the numeric department ID.
* USERID is the user's user ID.

For example:

* Replace $departmentName=100$ with the department name corresponding to the department ID "100", such as "DingTalk Open Platform".
* Replace $userName=zhangsan01$ with the user name corresponding to the user ID "zhangsan01", such as "John".

## Submit for Review

After creating a message template, click **Submit** to submit the template for review.

## Enable a Template

After the template passes the review, it is enabled automatically. When a message template is enabled, you can send template messages by calling the API. For details, see [Use a Template to Send Work Notification Messages](/zh/open/development/work-notification-templating-send-notification-interface).

## Disable a Template

When you no longer need a template, turn off the enable toggle to stop using the template.

## Delete a Template

Click **Delete** to delete a template.

## Clone a Template

Click **Clone** to copy a template with the same configuration.

## Test a Template

After clicking **Edit**, you enter the template editing interface. Click the **Test** button on the template editing page to run a test. The test sends a Work Notification to yourself.
