# Smart Messaging

Smart messaging allows to communicate with users via multiple channels:

* in-browser push (available for Chrome)
* sms
* email
* messengers (Viber, Telegram, FB, VK)

Messaging can be done:

* **manually** [\[ Step by step example → \]](/knowledge-base/pwability-1/pwability/message_customers_in_every_channel.md#send-messages-manually)
* **automatically (via operations)** [\[ Step by step example → \]](/knowledge-base/pwability-1/pwability/message_customers_in_every_channel.md#send-messages-automatically)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### MESSAGING SET UP

1. Add recepients to[ Objects](https://mobsted-2.gitbook.io/knowledge-base/objects) list
2. Fill in objects' **Name**/ **Phone** / **Email** fields
3. For Text messaging add SMSC account&#x20;
4. For Bots:&#x20;
   * add bot widget&#x20;
   * add bot to your tenant&#x20;

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### ADDING SMSC ACCOUNT

Each new Mobsted account has 10$ that could be spent on text messages.

If you want to continue sending out invites / notifications you should add your own [SMSC](https://smsc.ru/) account.Navigate to your Account Settings![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5xziyk96td/1564898604851/image.png)

1. Go to **Messages** tab
2. Enter your [SMSC](https://smsc.ru/) login credentials
3. Click **Save Changes**

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### **CREATING CONNECT BOTS WIDGET**

1. Creating Widget view:&#x20;

* Go to **Application** section in the header and click **Widgets**

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5reqjsopf2/1564430637943/image.png)

* Click **gear wheel icon** to customize the view of the widget![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5reqjsopf2/1564430978999/image.png)
* Drag and Drop **WBots** component to widget emulator![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5xziyk96td/1564468246676/image.png)
* Click **Edit Modal**
* Check **Show close button** checkbox is checked in **Modal Properties** menu on the right
* Click **Back** button.![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5reqjsopf2/1564431233662/image.png)

2\. Adding Widget Scenario:&#x20;

* Click **Add Scenario**
* Enter **Description**: *Add to Home Screen Widget appears on Home Screen with 10 seconds delay*
* In **Conditions** section check **Bots** checkbox ans set off the switcher. This is the instruction for the widget to check if user didn't connect **Bots** yet. **Icon, Push, vCard** checkboxes are unchecked, so platform will ignore them
* In **Where?** section select:

  * &#x20;**Event type**: **Screen**
  * Value: **Home Screen**

  &#x20;This is the instruction for the widget to appear on **Home Screen**
* In the **When?** section type **10** as **Delay**. This is the instruction for the widget to appear with 10 seconds delay
* In the **How many?** section enter:
* &#x20;**Total (times):&#x20;**&#x20;*5*
* &#x20;**In session (times):** *1*

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5xziyk96td/1564468092953/image.png)

* Click **Check mark** to save scenario.

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/5reqjsopf2/1564432452524/image.png)

#### \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### CONNECTING BOTS

Connect bots to your tennat:

* [Viber set up](https://kb.mobsted.com/article/ot06m3qvlj-set-up-viber-bot) \[ Step by step example → ]
* [Telegram set up](https://kb.mobsted.com/article/mlmio4h085-set-up-telegram-bot) \[ Step by step example → ]
* [Facebook set up](https://kb.mobsted.com/article/gn3gyamq88-set-up-facebook-bot) \[ Step by step example → ]
* [VK set up](https://kb.mobsted.com/article/q5py0hh0iz-vk-set-up) \[ Step by step example → ]

Note: if you have several bots connected the message will first go to the last one which has been used.&#x20;

Note: To start sending messages to a user - users has the added the bot and reply back to your initial message.&#x20;

Note: user always can disable the bot&#x20;

Note: Android device users will automatically recieve in-browser push widget. If accepted they will be also recieving push notifications via Chrome.&#x20;

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

#### SEND MESSAGE MANUALLY

1. Go to **Object** section of the platform&#x20;
2. Select 2 objects by checking the checkbox
3. Click **Message.** You will get to **Send Message** screen
4. Enter the message **"Hello, "**
5. From **LEGEND ACTION** section on the left select [hashtag](https://mobsted-2.gitbook.io/knowledge-base/hashtags) **#Object:Name#**. This way you get user name added to the text.&#x20;
6. Click **Send**. Possible options:\
   \- **Guaranteed**: to make sure the message is delivered no matter what\
   \&#xNAN;**- Push**: send as bots message and in-browser push for Chrome\
   \- **Email**: send as email\
   \- **Sms**: send as text message.

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/3pu33inp76/1557995491417/ezgif-com-video-to-gif-1.gif)

####

#### SEND MESSAGE AUTOMATICALLY

We create API operation and send personal message to users via different channels (email and text message).

**How to set it up:**

1. Go to **Object** section of the platform&#x20;

2. Select 2 objects by checking the checkbox

3.

4. Create API method to send message:

   * Navigate to **My Profile** Section in the top right corner![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/6vuz0emhjg/1557735264977/image.png)
   * Go to Keys tab and copy Primary and Secondary Key to your favourite note app.
   * Navigate to **API Providers** Section and click "Add API Provider"

   скрин шот API provider section&#x20;

5. Fill in it's **Name**: "Mobsted" and **Base URL**: https\://**\*yourTenantName\***.mobsted.com

6. Click **Save** and then click **Create New API Provider Method**

7. Name the fields:

* **Api Provider Method Name**: "send garant";
* **Method**: PUT;
* **Endpoint URL**: /api/v8/object/sendmessage
* **Consumes Type**: application/x-www-form-urlencoded
* **Produces Type**: application/json

7\. Click **Add parameters** at the bottom of the pop up and fill in the fields:

* **Name**: *applicationId*
* **In**: *query*
* **Type**: *Integer*
* **Description**: *Application ID*
* Check the box **Required**
* Click **Save Parameter**

8\. Click **Add parameters** again and fill in the fields:

* **Name**: *subject*
* **In**: *query*
* **Type**: *String*
* **Description**: *Message Subject*
* Check the box **Required**
* Click **Save Parameter**

9\. Click **Add parameters** again and fill in the fields:

* **Name**: "message";
* **In**: query;
* **Type**: String;
* **Description**: "Message Text";
* Click **Save Parameter**

10\. Add one more parameter, named **phone** using the same settings as the **message** parameter

11\. Click Save API Provider Method

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/hflsw49s60/1558001456494/image.png)

1. Go to **API KEYS** tab and click **Create New API Key**
2. In the Pop up fill in the fields:&#x20;

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/hflsw49s60/1558002134418/image.png)

1. **Api Key Name**: "Mobsted Key"; **Method**: Basic; **Key1 and Key2**: copy paste the keys you've copied on step **2-b** and click **Save** and then **Close** the pop up.
2. Click **Operations** on the Home Screen of your platform
3. Click "Add Operation"
4. From the dropdown on the left select **send garant** in the **Mobsted Provider** that we created on the previous step
5. Fill in the field: Operation Name: "**Send Message**";
6. In the **EXECUTION** section fill in the parameters:
   1. **API Key**: Mobsted Key;
   2. **applicationId**: 1 (in our case);
   3. **message:** Hello, #Object:Name#
   4. **subject**: Hello
   5. **phone:** #Object:Phone#
   6. **email:** #Object:Email#![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/3pu33inp76/1559499107053/image.png)
7. Click **Save Operation**
8. Display data on the App Screen
   1. Navigate to constructor
   2. Drag and Drop [Button element](https://kb.mobsted.com/article/ap8iv7mdhw-construstor-elements-build-app), fill in it's properties, the **Caption Button**: "Send Hello Message"
   3. Add an Action to the Button: select **Execute Operations** from the dropdown and select "**Send Message**" Operation in the next one and click Save
9. Check your work
   1. Navigate to **Objects** section of the App
   2. Launch the from the perspective of two Objects added earlier
   3. Click the **Send Hello Message** button
   4. The first App User should receive the message to the email, the second one - to his phone

####

#### GUARANTEED DELIVERY

All messages sent - either manually or automatically - can be sent via Guaranteed Delivery by default.

With Guaranteed Delivery messages are sent to user via various channels in the order of their priority (for example: messenger, email, sms), until the message is delivered. **привязать к описанию в Push messages & Bots - как определять приоритеты.**&#x20;

#### MENTIONED ARTICLES&#x20;

* Objects
* Connecting bots
* Hashtags
* Guarenteed delivery


---

# 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://mobsted-2.gitbook.io/knowledge-base/pwability-1/pwability/message_customers_in_every_channel.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.
