# SMS/Email

* [Bubble.io Plugin](#bubble.io-plugin)
* [JavaScript SDK](#javascript-sdk)

![](/files/qHT9WhUgvvAamln0DIPY)

### 🧋 Bubble.io Plugin

#### \[Element] Natively - SMS/Email

#### Events:

* **SMS action is not allowed \[iOS]** - Get called when user restricted sending SMS for other apps
* **SMS sent \[iOS]** - successfully sent an SMS
* **SMS sending failed \[iOS]**
* **SMS sending cancelled \[iOS]** - Sending SMS screen was closed
* **Email action is not allowed \[iOS]** - Get called when user restricted sending email for other apps
* **Email sent \[iOS]** - successfully sent an Email
* **Email sending failed \[iOS]**
* **Email saved \[iOS]**
* **Email sending cancelled \[iOS]** - Sending Email screen was closed

#### Actions:

* **Send SMS** - Displays native MessageComposeViewController
  * Subject
  * Recipient
  * Body
* **Send Email** - Display native MailComposeViewController
  * Subject
  * Recipient
  * Body

### 🛠 JavaScript SDK

#### NativelyMessage

{% code overflow="wrap" lineNumbers="true" %}

```javascript
const message = new NativelyMessage()
const send_sms_callback = function (resp) {
    console.log(resp.status); // SENT/CANCELLED/FAILED/NOT_ALLOWED (Works only on iOS)
};
const send_email_callback = function (resp) {
    console.log(resp.status); // SENT/CANCELLED/FAILED/NOT_ALLOWED/SAVED (Works only on iOS)
};
message.sendSMS(body, recipient, send_sms_callback);
message.sendEmail(subject, body, recipient, send_email_callback);
```

{% endcode %}


---

# 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://docs.buildnatively.com/guides/integration/sms-email.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.
