Actions43
- 用户标签 Actions
- 用户 Actions
- 模板 Actions
- 发布 Actions
- 其他 Actions
- 菜单 Actions
- 素材 Actions
- 草稿 Actions
- 评论 Actions
Overview
This node enables sending template messages through a WeChat Official Account. Template messages are pre-formatted notifications that can be sent to users who have interacted with the official account, allowing for personalized and structured communication.
Common scenarios include:
- Sending order confirmations or shipping updates to customers.
- Delivering event reminders or alerts.
- Notifying users about account activities or promotions.
For example, a business could use this node to send a purchase confirmation template message to a customer immediately after an order is placed, including dynamic data such as order number, delivery date, and customer name.
Properties
| Name | Meaning |
|---|---|
| 接收者Openid | The unique OpenID of the recipient user within the official account's scope. This identifies who will receive the template message. |
| 模板ID | The ID of the template message to send. This corresponds to a predefined message template configured in the WeChat Official Account platform. |
| 模板跳转链接 | (Optional) A URL that the template message will link to when clicked. Note that overseas accounts do not support clickable links in template messages. |
| 小程序 | (Optional) Data for linking to a WeChat Mini Program from the template message. Includes: • 小程序Appid: The AppID of the target Mini Program. • 小程序页面路径: The specific page path within the Mini Program, supporting query parameters. |
| 模板数据 | JSON object containing the dynamic data fields required by the template message. This must follow the format specified by the WeChat template message API. |
| 防重入ID | (Optional) A client-generated message ID used to prevent duplicate message sending (idempotency key). |
Output
The node outputs an array of JSON objects representing the response from the WeChat API for each input item processed. Each output item contains the result of the send operation, which typically includes success status or error details if the message failed to send.
If binary data were involved (e.g., media files), it would be included accordingly, but this node focuses on JSON responses related to message sending.
Dependencies
- Requires valid credentials for the WeChat Official Account API, specifically an API key or token with permissions to send template messages.
- The node depends on the WeChat Official Account platform's template message service.
- Proper configuration of the node’s credentials in n8n is necessary to authenticate API requests.
Troubleshooting
Common Issues:
- Invalid or expired API credentials causing authentication failures.
- Incorrect template ID or missing required template data fields leading to API errors.
- Sending messages to users who have not subscribed or authorized the official account, resulting in failure.
- Using unsupported features like Mini Program linking on overseas accounts where it is disabled.
Error Messages:
- Errors returned from the WeChat API will be captured and reported per item.
- If the node is set to continue on fail, errors will appear in the output JSON under an
errorfield. - To resolve errors, verify credentials, ensure template IDs and data match the official account setup, and confirm recipient OpenIDs are valid.
Links and References
These resources provide detailed information on template message formatting, required parameters, and limitations.