Actions38
- Chatbot Actions
- Contact Actions
- Message Actions
- Panel Actions
- Sequence Actions
- Session Actions
Overview
The "Send Template" operation of the Message resource in this node allows users to send templated messages through a specified communication channel. This is particularly useful for automating standardized communications such as notifications, alerts, or marketing messages where the content follows a predefined format with customizable parameters.
Typical use cases include:
- Sending appointment reminders using a template with dynamic fields like date and time.
- Dispatching order confirmations with customer-specific details.
- Delivering support responses that require consistent formatting but personalized data.
By leveraging templates, users can ensure message consistency while dynamically inserting relevant information per recipient.
Properties
| Name | Meaning |
|---|---|
| Bots Name or ID | Select or specify the bot to be used for sending the message. |
| Departments Name or ID | Select or specify the department associated with the message context. |
| User Name or ID | Select or specify the user within the chosen department who is responsible or related to the message. |
| From Name or ID | Select or specify the channel (e.g., messaging platform) from which the message will be sent. |
| Templates Name or ID | Choose the message template to send. The list depends on the selected channel. |
| Params | Key-value pairs representing parameters to fill in the template placeholders. Each parameter has a name (from available template parameters) and a value to insert. |
| To | The recipient's phone number or identifier to whom the message will be sent. |
| Url | URL of a file to attach if the template supports file attachments. |
| Field File | Name of the input field containing a base64-encoded file to attach if the template supports file attachments. |
| Send Synchronous Message | Boolean flag indicating whether the message should be sent synchronously (wait for confirmation before proceeding). |
| Enable Bot | Boolean flag to activate chatbot interaction upon receiving a response from the contact. |
| Hidden Session | Boolean flag to mark the session as hidden when sending the message. |
| Force Start Session | Boolean flag to force the start of a new session when sending the message. |
Output
The output JSON contains the response from the API after attempting to send the templated message. It typically includes details such as message ID, status, timestamps, and any metadata returned by the service confirming the message dispatch.
If a file is attached via URL or binary data, the node handles uploading the file first and then sends the template referencing the uploaded file by its ID.
No binary data is output by this node; it only returns JSON responses describing the result of the send operation.
Dependencies
- Requires an active API key credential for authenticating with the external WTS Chat API.
- The node depends on the availability of predefined templates and channels configured in the external system.
- For file attachments, the node uploads files to the service before sending the message, requiring network access and valid file data in the input.
Troubleshooting
- Missing Channel or Template: If the "From" channel or "Template" is not selected or set to undefined, the node throws an error prompting to fill these required fields.
- File Attachment Issues: Errors occur if the specified file field does not exist in the input or if no file or URL is provided when the template requires a file.
- Invalid Recipient Number: Sending fails if the "To" field is empty or invalid.
- API Errors: Any issues communicating with the external API (authentication failure, invalid parameters) are surfaced as errors with descriptive messages.
- Parameter Mismatch: If template parameters do not match those expected by the template, the message may fail or send incorrectly.
To resolve errors:
- Ensure all required fields (channel, template, recipient) are correctly filled.
- Verify file inputs exist and are properly formatted.
- Confirm API credentials are valid and have necessary permissions.
- Match template parameters exactly as defined in the template configuration.
Links and References
- n8n Expressions Documentation
- External WTS Chat API documentation (not included in source code, consult your service provider)