Send WhatsApp Template
Send WhatsApp Template
Section titled “Send WhatsApp Template”Type: mosend-send-template · Package: Mosend WhatsApp Activities v1.0.4 · Output: object
Sends an approved WhatsApp template (notification, reminder, confirmation) with the Mosend account. It is the only way to write to someone outside the 24-hour window: the first message to a customer, a shipping notice, a payment reminder. The variables fill the {{1}}, {{2}}… placeholders of the template.
How it works
Section titled “How it works”- Gets the Mosend session of the
integrationand identifies the sender numberfrom. - Builds the message with the template name (
template), the language (language, if set) and the variables. - Sends it to
toand returns the message id and status.
The body variables (variables) go in order: the first fills {{1}}, the second {{2}}, and so on. You can pass them as a list or as text separated by commas (,), pipes (|) or semicolons (;). All of them are sent as text.
If the template has an image or document header or dynamic buttons, use headerVariables with the keys Mosend expects; the body variables are added automatically under the body key.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
integration | string | — | Name of the Mosend account in the environment’s Centro › Recursos › Integraciones (Center › Resources › Integrations), Mensajería section. E.g.: mosend. |
from | string | — | WhatsApp number of the sending account, as shown in Mosend (e.g. +57 300 000 0000), or its Mosend id. |
to | string | — | Recipient phone in international format, with or without +. E.g.: +57 300 000 0001. |
template | string | — | Name of the approved template in Meta. E.g.: pedido_enviado. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
language | string | — | Template language code (es, es_CO, en_US…). Empty = the language of the first approved template with that name. |
variables | List | — | Body variables in order: the first fills {{1}}, the second {{2}}… E.g.: ["Test Customer", "#0001", "tomorrow"]. |
headerVariables | Dictionary | — | Header or button variables when the template has a media header or dynamic buttons (key → value, as Mosend expects them). Leave empty for text-only templates. |
Output
Section titled “Output”Returns an object with:
| Field | Description |
|---|---|
id | Message id in Mosend. |
status | Status reported by Mosend (defaults to sent). |
to | Recipient number, digits only. |
conversationId | Conversation id in Mosend. |
Common errors
Section titled “Common errors”The activity fails with these messages, without a prefix; catch them with Try / Catch:
| Message | Cause and fix |
|---|---|
'…' is required. | A required parameter is missing (the message names it). |
The Mosend integration '…' does not exist in this environment. Create it in Center › Resources › Integrations. | The integration name doesn’t match any Mosend integration in the environment where the robot runs. Check it under Integrations in Zoan Cloud. |
Mosend activities need the Zoan Cloud runtime context (…). | The process isn’t running from Zoan Cloud or from the Designer signed in. |
'to' must be a phone number in international format (e.g. +57 300 123 4567). | to has fewer than 8 digits. |
The 'from' WhatsApp number was not found in the Mosend organization. … | from doesn’t match any number in the account. Use the number as shown in Mosend or its id. |
Mosend responded HTTP 400: … | Mosend or Meta rejected the template: a name or language that doesn’t exist, a template that isn’t approved, or a number of variables different from what it expects. |
Zoan Cloud refused the Mosend session for '…': HTTP …: … | Zoan Cloud couldn’t hand out the integration’s session (for example, the OAuth authorization expired or was revoked). Reconnect the integration. |
Mosend rejected the session (401). Reconnect the integration in Center › Resources › Integrations. | The API key or token is no longer valid. Reconnect the integration. |
Mosend denied the operation (403): the account lacks the permission. … | The Mosend account doesn’t have permission for that operation. |
Mosend rate limit reached (429). Retry later. | Too many requests in a row. Retry with Retry and a wait. |
Mosend responded HTTP …: … | Another Mosend error; the detail (up to 300 characters of the response) follows the colon. |
Example
Section titled “Example”The order_shipped template says: “Hi {{1}}, your order {{2}} arrives {{3}}.”
Send WhatsApp Template integration = "mosend" from = "+57 300 000 0000" to = "+57 300 000 0001" template = "order_shipped" language = "en_US" variables = ["Test Customer", "#0001", "tomorrow"] → output: noticeThe customer receives: “Hi Test Customer, your order #0001 arrives tomorrow.”
Related activities
Section titled “Related activities”- List WhatsApp Templates — see the available templates.
- Send WhatsApp Text — free-form text inside the 24-hour window.
- Send WhatsApp File — send a file after the notice.