# Messages

Source: https://modulify.ai/docs/built-in/messages

Text your customers from your site, with booking and order texts and verification codes sent from approved templates, with credits for texts included in every plan.

Every site can send texts (SMS) to its customers: a booking confirmation, an order update, a verification code or an alert when someone fills in a form. Texts go out through Modulify, with nothing to sign up for. Every plan includes credits for texts each month for each site, and what they do not cover is paid from your workspace credits. Everything lives in the **Messages** tab under **More** in the editor, with four sub-tabs: **Overview**, **Templates**, **History** and **Settings**. In the Modulify app for iPhone and Android, **Messages** is in **More** too, with the same tabs, see [On the mobile app](https://modulify.ai/docs/build/site-chat#on-the-mobile-app).

Anyone with the Editor role on the site can use the tab. Unblocking a number and deleting a template also need the **Delete projects** permission, and without it those controls are disabled with the tooltip "You do not have permission to do this."

## Before you begin

Texting is on for every site from the start, on every plan, and every text is real: it reaches the person it goes to. Each site's plan includes credits for texts every calendar month: 2 credits on Free, 20 on Starter, 20 on Pro and 40 on Enterprise. Each text uses its own price from them, and what they do not cover costs credits from your workspace, see [Prices and credits](https://modulify.ai/docs/built-in/messages#prices-and-credits). Texts to the United States need your business registered with US carriers once, on any plan, see [US texting](https://modulify.ai/docs/built-in/messages#us-texting). Every site gets its own texting account with its first text, and the built-in templates are approved and ready to send before that.

## Overview

**Overview** opens with **Activity**: **Texts**, **Delivered**, **Failed** and **Credits** for the period you pick, each with a small chart of one bar per hour, day or month. Its date picker is the one the **Analytics** tab uses, from **Today** and **Last day**, the default, to **All time** or a custom range, and the counts keep themselves up to date while the tab is open. **Failed** gathers every text that did not arrive: failed, filtered, blocked or cancelled. **Credits** is what the texts cost once refunds are taken off.

**This month** below it shows the texts sent since the 1st, the credits they took, how many were delivered or failed, what today's texts cost and the daily credit limit. Then comes [Send a text](https://modulify.ai/docs/built-in/messages#send-a-text).

## Turn texting off and on

**Sending**, the last section of the **Settings** tab, holds the **Send texts from this site** switch. Turning it off asks first, **Turn off texting?**, because every text from the site is refused until you turn it back on, those its own code sends included. While it is off, **Overview** shows **Texting is off** with an **Open settings** button.

When **Modulify has blocked texting** for this site, its workspace or the account that owns the site, the switch cannot be turned on, and the **Sending** section says `Sending texts is blocked for this site`, `this workspace` or `the account that owns this site`, followed by `Contact support to find out why.` While the block applies, no text is sent, including the ones the site's own code sends, and a refused text is not queued.

Modulify can also pause texting on a site. Then **Overview** shows **Texting is paused** with `Modulify paused texting on this site, so every text is refused until it is resumed.`, and every text is refused until Modulify resumes it. Texting on a site is paused on its own when too many of the people it texts reply STOP, or when carriers filter or block too many of its texts, so contact support to have it looked at.

## Templates

Every first text has to use an approved template. A template is the text with placeholders for what changes from one text to the next, such as a name or an order number. Every site starts with six built-in templates: **Verification code**, **Form alert**, **Booking confirmed**, **Booking reminder**, **Order confirmed** and **Order status**. You can add your own, see [Your own templates](https://modulify.ai/docs/built-in/messages#your-own-templates). The examples under each built-in template show your site's own name and its primary address.

### Template review

The built-in templates are approved ahead of time for every site, so they show **Approved** from the start, even before the site's texting account is set up, and **Send for review** on a built-in template you did not edit approves it at once. Your own templates, and built-in ones you edited, are reviewed on their own, separately on every site. **Send for review** in a template's menu sends it for review. The badge next to its name shows where it stands, and the info icon in the badge explains it:

| Status | What it means |
| --- | --- |
| **Default** | A built-in template not sent for review yet. Send it for review so your site can send texts with it |
| **Draft** | One of your own templates, or a built-in one you edited, not sent for review yet. Send it for review so your site can send texts with it |
| **Pending** | It is in review. Your site can send texts with it once it is approved, and you get a notice here when it is |
| **Approved** | It was approved, so your site can send texts with it |
| **Rejected** | It was rejected, so it cannot send texts. Edit the text and send it again, or let the AI fix it |
| **Paused** | It was paused, so it cannot send texts until it is resumed |
| **Disabled** | It was turned off, so it cannot send. Send it for review again to submit a fresh copy |

Only an approved template can send texts. While a template is pending, the tab checks its review on its own, and when the review ends, the person who sent it for review gets a notice in the editor, such as **Template approved** or **Template rejected**.

When a template is rejected, the reason shows under it, for example `Review note: The link must point to a domain you own.`, or `No reason was given.` when there is none. When its text is not accepted for review, the template stays **Default** or **Draft** with an orange warning icon and the reason after `Sending it for review failed:`. **Fix with AI** in the menu of either one puts the template and the reason in the chat box, so the AI can change the text and send it again.

Sometimes the review cannot start for a reason that has nothing to do with the template, for example while texting for the site is still being set up. The template then stays **Default** or **Draft** with the reason under it in gray, such as `Texting for this site is still being set up, so the review could not start yet. It is sent for review again on its own.` There is nothing to fix: it is sent for review again on its own until the review starts, and the person who sent it for review gets the same notice in the editor when the review ends. **Send for review** tries again at once.

**Edit template** changes the text of a template that is **Default**, **Draft**, **Rejected** or **Disabled**, and sends it for review again. A built-in template keeps its name, and **Verification code** keeps its text.

### Your own templates

**Create template** opens **New text template**. Give it a **Name**, such as Pickup ready, and write the **Text** with each placeholder in double braces:

```text
Hi {{name}}, your order {{order}} is ready to collect at {{site}}. Reply STOP to opt out.
```

Each placeholder gets an example under **Examples**. The text is reviewed with these, so make them realistic. `{{site}}` is filled with your site's name on its own, and a placeholder named `link` or `url` needs a full link that starts with `https://`. **Preview** shows the text with the examples filled in, and **Add "Reply STOP to opt out."** adds that line when the text has no way to stop the texts.

Turn on **Promotion** for a text that promotes something, such as a sale, an offer, news or an event, and leave it off for an update about something the person did, such as a booking, an order or a form they sent. The review checks that the words match the kind: an update with an offer or a discount in it is refused, and a promotion has to say how to stop the texts. A built-in template keeps its own kind, so the switch shows only on your own templates.

Before anything is sent for review, the dialog checks the rules a template has to follow:

- A word before the first placeholder and after the last one.
- A word between two placeholders.
- At least two words for each placeholder, plus one.
- Each placeholder used once, at most 10 of them, and a text of at most 1,024 characters.
- A promotion with the word STOP in it, such as `Reply STOP to opt out.`

Then the text is checked against the review rules. When it would likely be rejected, nothing is sent for review and you see why, such as `Remove the discount, because an update cannot promote anything.` Fix every reason and send it again. Texts for something texting cannot be used for, such as pretending to be a bank, asking for card details or selling cannabis, are refused the same way. The same check runs when you send a template of your own for review from its menu, and its reasons then show under the template.

A template is approved sooner when an update sticks to the one thing it is about, the text names your site with `{{site}}`, each language is a template of its own, and links go to your own site with a full `https://` address rather than through a link shortener. For sign-in codes, use **Verification code** rather than a template of your own.

**Send for review** saves the template and sends it for review. A site can have 20 templates of its own, with names of up to 40 characters that no other template on the site has. Your own templates show **Yours**, and **Delete template** deletes one for good, after asking **Delete this template?**. Texts already sent with it stay in the history.

## Send a text

**Send a text** on the **Overview** tab sends one text, as an SMS. Pick the **Template** and the **Phone number** in international format, such as `+14155551234`, then fill in the template's fields. The preview shows the text, and the form shows what it costs: `Included in your plan, 1.4 credits left this month` while the included credits cover the whole text, `Costs 0.3 credits after the credits your plan includes` when they cover part of it, its price in credits once they are used up, and `Texts to the US need your business registered first, in Settings` for a US number before your business is registered. **Send text** sends it right away.

A text is refused while texting is off or paused, to a country the site may not text, to a number that is blocked or replied STOP, with a template that is not approved, to a US number while the workspace is below Pro, to a US number before your business is registered, to a US number while the registration is in review, see [US texting](https://modulify.ai/docs/built-in/messages#us-texting), and to a country marked **Registration needed**, **In review**, **Action needed** or **Not available**, see [Countries](https://modulify.ai/docs/built-in/messages#countries). A site can send 30 texts a minute, 5 texts to one number a day and 20 credits of texts a day on Pro, see [Limits](https://modulify.ai/docs/built-in/messages#limits).

## Prices and credits

A text's price in credits is set by the country it goes to and the number of parts it takes. Each site's plan includes credits for texts every calendar month, see [Before you begin](https://modulify.ai/docs/built-in/messages#before-you-begin), and every text uses its price from them first, so texts to an expensive country use them up sooner. When the included credits cover only part of a text, your workspace pays the rest, and once they are used up it pays the whole price. They start again on the 1st, in UTC, and a text that does not arrive gives back all the credits it used, included ones too. An SMS part holds 160 characters, or 153 in a text of several parts, and a text with an emoji or another character outside the plain SMS alphabet holds 70, or 67 in a text of several parts. The first text to a number each calendar month adds a small fee once. **Countries** on the **Settings** tab shows the price of one part to each country.

The price can only go down once the final cost is known, and the difference comes back to your workspace. A text that fails, is filtered, is blocked or is cancelled gets its credits back. Texts count as **Texts** in your workspace's credit usage, and under your workspace [spending caps](https://modulify.ai/docs/plans/spending).

## History

**History** lists every text the site sent, newest first, with its template, number, status and cost, or **Included** for a text your plan's credits paid in full. Pick **All statuses**, **In progress**, **Delivered**, **Failed** or **Cancelled**, or search by phone number. The list shows 25 texts a page, with page numbers under it once there is more than one page, and in the mobile app older texts load as you scroll instead. The page you are on is part of the address, such as `?page=3`, so a refresh, the back button and a shared link keep it, and the page numbers are links, so cmd-click opens a page in a new tab. A link past the last page opens the last one. Picking a status or searching goes back to the first page. Opening a text shows its status, every delivery update, the text that went out with a verification code masked, the credits it cost and whether they came back. A text cut off before it went out is marked **Failed** after a few minutes with `Sending was cut off before the text went out, so its credits were given back.` It updates on its own while the text is on its way, and **Cancel text** stops one that has not gone out yet, after asking **Cancel this text?**. Texts stay in the history for 90 days.

## Settings

### Sender name

**Sender name** is the name people see on texts, where their country allows it. It takes 3 to 11 letters, digits and spaces, and other characters are left out. It is the same for every text from the site. Unless you set one, it is made from the site's name when the site's texting account is set up, and renaming the site later does not change it.

A site gets its texting account the first time it needs one: with its first text, when a template of its own is saved or sent for review, or when its business is registered for US texting. Until then **Texting account** says so, the built-in templates are already **Approved**, and a sender name you save is used when the account is set up. The account carries the site's name, address and description and the email of its workspace owner, kept up to date as they change. Once it has one, **Account** says whether the site's texting account is **Ready**, **Setting up** or **Not ready**, or **Needs a business registration** when the site picked the United States before its business is registered, and **Sender number** shows the number its texts go out from, or **Shared route** when they go out from shared numbers.

### US texting

Texts to US numbers need a Pro plan and your business registered with US carriers. You register once per site. Some other countries need a registration too, see [Countries](https://modulify.ai/docs/built-in/messages#countries). The United States also has to be among the site's [countries](https://modulify.ai/docs/built-in/messages#countries). **US texting** shows **Business registration** with where it stands: **Not registered**, **In review**, **Action needed** or **Approved**.

Publish your site first: US carriers check the live site before they approve its texts, so until it is published **Register business** is disabled with the reason.

**Register business** opens **Register your business for US texts**. Pick the **Business type**: **Company**, **Sole proprietor (no company)** if you do not have a company, **Non-profit**, **Public company** or **Government**. Then give the **Legal name** on your tax records, the **Name people know you by**, your **Tax ID (EIN)**, the business address, a **Website**, the contact carriers can reach, and **How people agree to get your texts**, which starts written from your site. Change it when people sign up some other way. Tick **These details are correct, and people agree before this site texts them.** and **Send for review**.

Modulify adds the rest for you: a texting privacy page and terms for your site, sample texts from your approved templates, and the STOP and HELP replies, all with your site's name and primary address. Your site needs at least one approved template first. US carriers usually answer in 3 to 7 business days. Once approved, the card reads `Texts to the US go out from your own number`, with the number. When carriers ask for a change, the card shows **Action needed**, and **Fix details** opens the form again with what you sent, except the tax ID, which you enter again.

Registering needs the **Delete projects** permission, because it files your business details, and without it **Register business** is disabled with the reason. Until the registration is approved, a text to a US number is refused with `Texts to US numbers need the site's business registered with US carriers first. Register it under Messages > Settings > US texting!`, or while it is in review with `Texts to US numbers go out from this site's own number, which comes once its business registration is approved. Try again once it is approved!`, with no credits taken.

Texting the US is part of Pro. Below Pro, **Register business** is disabled with `Upgrade to Pro to text the US.`, the send form shows `Texts to the US need a Pro plan`, and a text to a US number is refused with `Texts to US numbers need a Pro plan. Upgrade the workspace to Pro to send them!`, with no credits taken. A site that already has its own US number keeps it: the card reads `Texts to the US need a Pro plan. Upgrade to Pro to send them from your own number again.`, and its texts to the US go out again once the workspace is on Pro.

### Countries

**Countries** lists every country texts can go to, more than 230 of them, each with the price of one part, and the ones the site already texts come first. **Search countries** finds one by its name or its code. Pick the countries the site can text, up to 3 on Starter and 5 on Pro, and the count above the list says how many you picked. **Select all** picks every country, or every result while you search, when that many fit your plan, and otherwise it is disabled with the reason. **Clear all** unpicks every country after asking **Clear every country?**. A text to a number in any other country is refused. When saving a template of your own, or sending one for review, sets up the site's texting account while no country is picked, the country you are in is picked for it, unless texts to it need a registration, as to the United States, or it is marked **Not available**. A number from a territory that dials through another country's code, such as the Åland Islands with Finland's, counts as that country.

A country whose carriers need the site registered first is marked **Registration needed**, then **In review** while the registration is checked and **Action needed** when carriers ask for a change, and texts to it are refused until it is approved. A country texts cannot go to is marked **Not available**, and texts to it are refused.

Texts to the United States go out from a US number of the site's own, which comes with your business registration, see [US texting](https://modulify.ai/docs/built-in/messages#us-texting). Texts to other countries go out under the site's [sender name](https://modulify.ai/docs/built-in/messages#sender-name), where the country allows it.

### API access

**API access** shows the **API URL** and the **Texting key** your site's code sends texts with, with buttons to copy them, show the key and rotate it. Showing and rotating the key need the **Delete projects** permission. Rotating asks **Rotate the texting key?** first, because the old key stops working at once: the preview gets the new key right away, and the live site keeps the old one until you publish again, so its texts fail until then. A site that moves to another workspace gets a new key the same way.

### Blocked numbers

**Blocked numbers** lists the numbers the site never texts. Someone who replies STOP to a text lands here on their own, shown as **Replied STOP**, and only they can opt back in, by texting START. **Block number** blocks a number yourself, shown as **Blocked**, and **Unblock number** takes it off the list again. The list shows 25 numbers a page, newest first, with page numbers under it once there is more than one page, or **Previous** and **Next** in the mobile app. The page you are on is part of the address, such as `?page=3`, so a refresh, the back button and a shared link keep it, and the page numbers are links, so cmd-click opens a page in a new tab. A link past the last page opens the last one. Blocking a number takes the list back to its first page.

### Sending

Sites started from some business pages also remind you in the AI chat. Until carriers approve your business, a notice above the chat box reads `Register your business to text US numbers`, and its **Register business** button opens **Settings** here. When carriers ask for a change, it reads `US carriers need a change` with **Fix details**. Close it with the **X** and it stays closed for you on that site, on every device, until carriers ask for a change.

**Sending** turns texting off and on for the whole site, see [Turn texting off and on](https://modulify.ai/docs/built-in/messages#turn-texting-off-and-on).

## What the AI can do

Chat can do everything the tab does. Ask it to write a template and send it for review, fix a rejected one, send a text, count the texts over a period, read the history, block a number or turn texting off and on, and it does it with its site actions. It asks you first before it sends a text, adds the United States to the countries, registers your business for US texts, turns texting off, unblocks a number, deletes a template or rotates the texting key. When it writes a template, it marks a promotion as one and keeps to what the review accepts. When you would rather write a template yourself, ask for that and it shows a card that opens **New text template** with its draft filled in. It also writes your site's code that sends texts, see [Send texts from your site's code](https://modulify.ai/docs/built-in/messages#send-texts-from-your-sites-code). It knows where your US registration stands, so when you ask it to text a US number before your business is approved, it tells you so instead of trying, and offers to fill in the registration with you.

## Send texts from your site's code

Your site's own server code can send texts too, such as a verification code at sign-up or a booking text when a form is sent. Ask chat for it, and it writes the code with the helper `@/lib/modulify/messages`, which it keeps in your project at `src/lib/modulify/messages.ts`:

```ts
import { sendText } from '@/lib/modulify/messages'

await sendText({
    to: '+14155551234',
    template: 'order_confirmed',
    variables: { name: 'Ana', order: '#1042', total: 'EUR 48.00' },
    idempotencyKey: `order-confirmed-${order.id}`
})
```

The helper reads two [managed secrets](https://modulify.ai/docs/data/secrets), `MODULIFY_MESSAGES_URL` and `MODULIFY_MESSAGES_KEY`, which reach the preview when it starts and your published site when you publish it. It runs only on the server, never in the browser. Texts from your code follow the same rules as the tab: the credits your plan includes, the template review, the countries and the limits, and they show in the **History** like any other text. A verification code is your site's to check, so your code keeps a hash of the code it sent and compares it with what the visitor types. Every text costs credits, so a form that texts a number a visitor types needs a limit per visitor and per number. The [Messages HTTP API](https://modulify.ai/docs/built-in/messages-http-api) lists every call, field and error.

## MCP and the API

The [Messages tools](https://modulify.ai/docs/mcp/tools#messages) do everything the tab does from an AI client or the [HTTP API](https://modulify.ai/docs/api): reading needs the `config:read` scope and changing anything `config:write`.

## Limits

| Limit | Value |
| --- | --- |
| Credits for texts included a month, per site | 2 on Free, 20 on Pro |
| Texts a minute, per site | 30 on Pro |
| Texts to one number a day | 5 on Pro |
| Credits of texts a day, per site | 20 on Pro |
| Countries a site can text | 5 on Pro |
| Value of one placeholder in a text | 120 characters |
| Templates of a site's own | 20 |
| Placeholders in one template | 10 |
| Template name | 40 characters |
| Template text | 1,024 characters |
| How long texts stay in the history | 90 days |