Actions18
Overview
This node integrates with the WeChat Official Account API to send template messages to users. Template messages are pre-defined message formats that can include dynamic data and links, allowing businesses or services to communicate structured notifications, alerts, or updates to their followers on WeChat.
Common scenarios for this node include:
- Sending order confirmations or shipping updates to customers.
- Delivering appointment reminders or event notifications.
- Providing personalized marketing messages with clickable links.
For example, a retail store could use this node to send a purchase confirmation template message including the customer's name, order details, and a link to track the shipment.
Properties
Name | Meaning |
---|---|
接收用户ID (to_user) | The OpenID of the recipient user in the WeChat Official Account system. This identifies which user will receive the template message. |
跳转链接 (url) | A URL that the template message will link to when clicked. Note: Overseas accounts do not support clickable links. |
消息模版 (template_id) | The ID of the message template to use. The list of available templates is dynamically loaded from the WeChat API. |
模板数据 (data) | JSON object containing the data fields to populate the selected template. This must match the template's expected structure. |
Output
The node outputs JSON data representing the response from the WeChat API after attempting to send the template message. This typically includes success or error information such as message IDs or error codes.
No binary data output is involved.
Dependencies
- Requires an API key credential for authenticating with the WeChat Official Account API.
- The node uses the base URL
https://api.weixin.qq.com/cgi-bin/
by default but can be configured via credentials. - The "消息模版" property dynamically fetches available templates from the
/template/get_all_private_template
endpoint.
Troubleshooting
- Invalid OpenID: If the provided user ID is incorrect or the user has not followed the official account, the message will fail to send.
- Template ID errors: Using a non-existent or unauthorized template ID will cause errors. Ensure templates are properly created and accessible.
- Data format issues: The
data
JSON must conform exactly to the template's required fields; otherwise, the API will reject the message. - Link restrictions: For overseas accounts, the
url
field is ignored; attempts to use it may cause unexpected behavior. - API authentication failures: Verify that the API key credential is valid and has necessary permissions.