Actions77
- 被动回复 Actions
- 留言管理 Actions
- 客服消息 Actions
- 素材管理 Actions
- 草稿管理 Actions
- 菜单管理 Actions
- 发布管理 Actions
- 消息模板管理 Actions
- 用户管理 Actions
消息模板管理 → 发送模板消息
AI-generatedSummary
Sends a formatted template message to a WeChat Official Account user via their OpenID.
Inputs
- touser (required) — The OpenID of the user to receive the template message.
- template_id (required) — The template ID used to generate the message content.
- data (required) — A JSON object containing key-value pairs for the template's data fields (e.g., 'first', 'keyword1'). Each key must match the template's placeholders and its value must be an object with a 'value' property.
- url — A link that will be opened if the user taps the template message. If both this and 'miniprogram' are empty, the message opens the WeChat client with no external navigation.
- miniprogram — A collection specifying the AppID and page path to open a mini-program when the user taps the message. Takes precedence over 'url' if both are provided.
- client_msg_id — A unique ID used to prevent duplicate messages for the same OpenID within a 10-minute window. Optional if message duplication is not a concern.
Output shape
A single item containing the JSON response from the WeChat API.
The response includes standard fields such as 'errcode' and 'errmsg'. The API may return error codes (e.g., 45047 for daily limit) and the node will fail the execution if the API response indicates an error.
Examples
Example 1: Send a personalized order confirmation using a template ID and a JSON data payload.
touser: UserOpenID, template_id: Template123, data: { 'keyword1': { 'value': 'Order #12345' }, 'date': { 'value': '2023-10-27' } }
Example 2: Send a notification with a link to a website.
touser: UserOpenID, template_id: AlertTemplate, data: { 'message': { 'value': 'Event starting soon' } }, url: 'https://example.com/event'