# Send SMS

### Send an SMS to a Recipient

Choose the recipient number, the masked phone number receivers will see, and the text message body.&#x20;

Choose between a contact from the Contacts, manually adding a phone number, or enter a previously collected parameter (such as $CALLER\_PHONE\_NUMBER, etc.) that stores a phone number. <br>

![](https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_81A0PNZfdawu_TPAO%2F-Mb1qAnO84NwWF4qdpKK%2F-Mb1rv1NQ3UXvzhG5sOc%2FScreen%20Shot%202021-05-31%20at%2017.37.18.png?alt=media\&token=89e0c8d3-8a7a-4e88-bd3a-ff163f7a38bb)

### Sending values collected in the conversation

In the SMS, you are able to use parameter values collected in the conversation, simply use $PARAM\_NAME in the SMS body.

E.g.&#x20;

*Dear $CUSTOMER\_FIRSTNAME,*&#x20;

*I have updated account Number $ACCOUNT\_NUMBER with the renewal of your subscription.*

*Have a good day!*&#x20;

{% hint style="warning" %}
*In some countries like the US, it is not permitted to send and SMS without displaying the phone number and carriers will block these SMS.*&#x20;

*Make sure to add the virtual assistant's phone number to the sender.*
{% endhint %}

###

### Sending an SMS to a collected phone number

If you want to send an SMS to a number that you collect in the conversation (instead of the caller ID) you will need to add the country code in a custom code node.&#x20;

Place a Custom Code node after the Collect Input node, that collects the phone number from the user.

For US numbers, you will have to add this code to the custom code node.

```
var number = $PHONE_NUMBER
if (number) {
    return ‘1’ + number.split(‘-’).join(‘’)
}
```

####


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://studio.docs.ai.vonage.com/whatsapp/nodes/actions/send-sms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
