# Make recipes

> Send texts from Make scenarios and start one whenever a text comes in.

Three recipes for Make. Each names its trigger and the BlueBot step, lists the fields to map and says how to test it with your own number before anyone else gets a text.

## How Make connects

- **[Make](https://usebluebot.com/docs/make)**: BlueBot’s Make app sends texts and starts scenarios when a text comes in or changes state.

## Text each new row in a sheet

| Part             | What it is                                   |
| ---------------- | -------------------------------------------- |
| Trigger          | Google Sheets’ Watch New Rows module in Make |
| Action           | BlueBot’s **Send Text** module               |
| Connects through | [Make](https://usebluebot.com/docs/make)                           |

### Steps

1. Start the scenario with Google Sheets’ Watch New Rows on the sheet you fill in.
2. Add BlueBot’s Send Text module and map the phone column to the recipient.
3. Write the text with the first name column mapped in.

### Map the fields

| BlueBot field                | Map it to                                                                                                                                 |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| To                           | The person’s mobile number from Make. US numbers can leave off the +1.                                                                    |
| Text                         | Hi {{first_name}}, your {{service}} is booked for {{date}}. Reply here if you need to change it.                                    |
| `{{first_name}}` in the text | Make’s first name field.                                                                                                                  |
| `{{service}}` in the text    | Make’s service field.                                                                                                                     |
| `{{date}}` in the text       | Make’s date field.                                                                                                                        |
| Metadata                     | `source` set to `make`, and `record_id` set to the record’s id, so the status and reply webhooks for this text can find the record again. |
| Service                      | Auto, the default: iMessage when the person uses it, otherwise SMS through your iPhone.                                                   |

### Test it

Put your own number in **To** and press **Run once**. A text arrives on your phone, and the module’s output shows the message with `state: "queued"`. Then map Make’s field back into **To**.

## Sort replies by what they say

| Part             | What it is                                                                   |
| ---------------- | ---------------------------------------------------------------------------- |
| Trigger          | A text comes in (BlueBot’s message.received webhook)                         |
| Action           | BlueBot’s **Watch Incoming Texts** module starts it, and Make takes the text |
| Connects through | [Make](https://usebluebot.com/docs/make)                                                           |

### Steps

1. Start the scenario from BlueBot’s webhook for incoming texts.
2. Add a router with a filter on each route, such as texts that mention “price” or “book”.
3. Send each route where it belongs, such as a row in a sheet or a message to your team.

### Map the fields

| From BlueBot    | Into Make                                                                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **From**        | The phone number to find the person by in Make. It’s in E.164 (`+15555550123`); search by the last 10 digits if Make stores numbers another way. |
| **Text**        | The words, for a note, a row or a message. Null when the person sent only a picture.                                                             |
| **Received At** | When it came in, in UTC.                                                                                                                         |
| **Files**       | Pictures and voice memos. Each `url` works for an hour, so copy a file you want to keep.                                                         |
| **Chat ID**     | Set when the text came in a group chat; null for a one-to-one text.                                                                              |

### Test it

Press **Run once** in Make, then text your BlueBot number from another phone you’ve texted through BlueBot before. The scenario runs with that text. BlueBot copies texts from people you’ve texted through it, unless you set **Which chats to copy** to **Everything**.

## Catch texts that fail

| Part             | What it is                                      |
| ---------------- | ----------------------------------------------- |
| Trigger          | A text fails (BlueBot’s message.failed webhook) |
| Action           | Make acts on what BlueBot reports               |
| Connects through | [Make](https://usebluebot.com/docs/make)                              |

### Steps

1. Send your texts with a record’s ID in metadata, which BlueBot echoes on every webhook for that text.
2. Start a second scenario from BlueBot’s message.failed webhook.
3. Use the ID to mark the record in your app, or email yourself the number that didn’t take the text.

### Map the fields

| From BlueBot       | Into Make                                                                                 |
| ------------------ | ----------------------------------------------------------------------------------------- |
| **State**          | `sent`, `delivered`, `read`, `failed` or `expired`, for a field or a filter.              |
| **Metadata**       | The `record_id` you sent with the text, to find the record it was for.                    |
| **Failure Reason** | Why a failed text didn’t go: `not_on_imessage`, `messages_refused` or `file_unavailable`. |
| **To**             | Who the text was for.                                                                     |

### Test it

Send one text to your own number, then look for the event. To try the step without sending anything, `POST /v1/webhooks/{id}/test` sends an example of any event type to your webhook.

## Before you turn it on

- Text only people who asked to hear from you. Anyone who replies STOP goes on your stop list, and BlueBot cancels texts to them. [Stop words](https://usebluebot.com/docs/concepts/stop-words)
- A text that can’t go yet waits with a hold rather than failing: quiet hours, your Mac away, a daily limit. [Holds](https://usebluebot.com/docs/concepts/holds)
- [Make with BlueBot](https://usebluebot.com/integrations/make) on the integrations page says what else the two do together.
