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, an e-commerce platform can use this node to send a purchase confirmation template message to a buyer’s WeChat account, including dynamic data such as order number, delivery date, and customer name.
Properties
| Name | Meaning |
|---|---|
| 接收者Openid | The unique OpenID of the recipient user in the WeChat Official Account system. This identifies the message recipient. |
| 模板ID | The ID of the message template to use. Templates must be predefined in the WeChat Official Account backend. |
| 模板跳转链接 | A URL that the template message will link to when clicked. Note: Overseas accounts do not support clickable links. |
| 小程序 | Data for linking to a mini program within WeChat instead of a URL. Contains: - 小程序Appid: The app ID of the target mini program. - 小程序页面路径: The specific page path inside the mini program, supports parameters. |
| 模板数据 | JSON object containing the dynamic data fields required by the template. This should follow the structure defined by WeChat's template message interface. |
| 防重入ID | An optional client 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 after attempting to send the template message. Each output item corresponds to one input item processed.
The json output typically contains:
- Success or error information returned by the WeChat API.
- Confirmation details if the message was sent successfully.
No binary data is output by this node.
Dependencies
- Requires valid credentials for the WeChat Official Account API, specifically an API authentication token or key configured in n8n.
- The node depends on the WeChat Official Account service being accessible and properly configured with the necessary templates and permissions.
- Network connectivity to the WeChat API endpoints is required.
Troubleshooting
Common issues:
- Invalid or expired API credentials causing authentication failures.
- Incorrect template ID or missing template data fields leading to API errors.
- Recipient OpenID not found or user not subscribed to the official account.
- Using unsupported features like URL links in overseas accounts.
Error messages:
- Errors returned from the WeChat API will be included in the node output. Common messages include invalid parameter errors or permission denials.
- If the node encounters an error during execution, it will throw an error unless "Continue On Fail" is enabled, in which case the error details are included in the output JSON.
Resolution tips:
- Verify API credentials and refresh tokens if needed.
- Ensure the template ID exists and matches the data provided.
- Confirm the recipient OpenID is correct and the user has interacted with the official account.
- Avoid using unsupported features depending on account region.