> ## Documentation Index
> Fetch the complete documentation index at: https://docsv4.mile.app/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS

> Send an automatic text message to a phone number on the task.

The **SMS** channel of the [Notification](/pages/workflow/automation/actions/notification) action sends a plain text message to a phone number stored on the task. Unlike WhatsApp through Fonnte, it needs no third-party key: the message is sent for you. It's available for **On Task Created**, **On Task Assigned** and **On Task Finished**.

<Note>
  Required permission:

  * View automation
  * Create automation
</Note>

<Note>
  SMS is offered only to accounts with the official sender. Other accounts see WhatsApp (Fonnte) only.
</Note>

## Set it up

1. On **Workflow › Automation**, click **New**.
2. Enter a **Name**, choose an **Event** (On Task Created, On Task Assigned or On Task Finished) and the **Task Type**.
3. **Automation Type**: **Notification**.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/automation/action-notification-sms.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=bf13bcde45b8a24d616836279c476364" alt="SMS notification" width="600" data-path="images/v4/workflow/automation/action-notification-sms.png" />
</div>

1. **Notification Channel**: **SMS**.
2. **Receiver Phone Number**: required. The task type's **Phone Number** field that holds the recipient's number. The task's value for that field is where the SMS goes; if it's empty on a task, nothing is sent for that task.
3. **Message**: required. The text of the SMS, prefilled with the default message.

Click **Submit**.

<Note>
  The SMS is only delivered to a **Phone Number** field on the **first page** of the task type. If you pick another kind of field, or a phone field on a later page, nothing is sent. Move the field to the first page if needed.
</Note>

## Placeholders

Anywhere you write a `{{ }}` placeholder, it's replaced with the real value from the task when the SMS is sent:

| Placeholder | Replaced with |
| - | - |
| `{{ organization name }}` | Your organization's name. |
| `{{ tracking link }}` | The task's public tracking link. |
| `{{title}}` | The task's title. It's only filled in when a field of the task type is set to show as the task title. |
| `{{status}}` | The task's current status. |
| `{{fieldname}}` | The value of any field of the task, by its name. |

Example:

```
Hi, your delivery from {{ organization name }} is on the way. Track: {{ tracking link }}
```

* A placeholder that can't be filled in (a misspelled name or an empty field) becomes empty text. The message is still sent, and recipients never see a raw `{{ }}`.
* Placeholder names are not checked when you save, so proofread them.

## Message length

The message that is actually sent is cut off at **160 characters**, after the placeholders are filled in. Placeholders often grow much longer than their names: a tracking link alone is about 50 characters. Keep your own text to about **100 characters** so the whole message, including a tracking link at the end, reaches the recipient.

## Cost

Each SMS uses your organization's **Credits** balance, the same balance used by WhatsApp, email and OTP messages. The credits per message depend on the destination country. Credit is only used when the SMS provider accepts the message; a failed send costs nothing.

**Your own SMS gateway.** If your organization has connected its own SMS gateway on [SMS Gateway](/pages/settings/integration/sms-gateway), automation SMS messages go through it and use no credit. Nothing changes in the automation. If the gateway is turned off or removed, messages go back through the default provider and use credit again.

**Not enough credit.** The balance is checked when the automation runs, not when you save it. You can always save an SMS automation, even with no credit. When it runs without enough credit, nothing is sent and nothing is charged, and the [log](/pages/workflow/automation/log) records it. The same happens if the balance can't be checked at that moment. Top up and the next task sends normally.

## Questions

**Why isn't my field in Receiver Phone Number, or why isn't the SMS sent?** Use a Phone Number field on the first page of the task type.

**Do I need an API key?** No. Connecting your own SMS gateway is optional and only changes who pays.

**What if I mistype a placeholder?** It's sent as empty text; the rest of the message is delivered.

**How much does one SMS cost?** It depends on the destination country, and nothing when you use your own gateway.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.