# Microsoft Dynamics 365 Customer Insights - Journeys messaging

SMS  
WhatsApp  
RCS  
Viber

Microsoft Dynamics 365 Customer Insights - Journeys app, integrated with Infobip, offers robust messaging capabilities across SMS, RCS, WhatsApp, and Viber.

The integration with Microsoft Dynamics 365 Customer Insights - Journeys provides the following benefits:

- Enhance customer engagement with multi-channel communication
- Simplify operations with a single interface for all messaging needs
- Channel-specific capabilities for SMS, WhatsApp, RCS, Viber
  
SMS messaging offers:

- **Direct communication**: Reach customers instantly on mobile devices
- **Personalization**: Use customer-specific data for tailored messages
- **Inbound messaging**: Trigger journeys based on customer replies
- **Real-time analytics**: Track delivery and engagement for campaign insights

WhatsApp, RCS, Viber messaging offers:

- **Rich media support**: Send images, videos, and clickable links
- **Trigger-based journeys**: Automate interactions based on customer actions
- **Failover mechanism**: Switch to SMS if primary channels fail
- **Unified templates**: Maintain consistency across channels

## What you will need
  
Before you start, you will need:

- Your Infobip account. If you do not have an Infobip account, you can [create one](https://www.infobip.com/signup)
- Microsoft Dynamics 365 account with the Customer Insights solution
- **Infobip Messaging Admin** or **Infobip Messaging User Marketing** security role in Dynamics to access and configure the app.

For more information on configuration, see the [Dynamics 365 Customer Insights - Journeys documentation](https://learn.microsoft.com/en-us/dynamics365/customer-insights/journeys/).

## Configure SMS in Customer Insights – Journeys

The SMS channel is available in Microsoft Dynamics 365 Customer Insights – Journeys using the native SMS integration with Infobip.

To configure the SMS channel connection to Infobip, follow the [Set up text messaging](https://learn.microsoft.com/en-us/dynamics365/customer-insights/journeys/real-time-marketing-text-messaging-setup) instructions in the Microsoft Dynamics 365 Customer Insights documentation.

## Install the app - WhatsApp, RCS, Viber

The Microsoft Dynamics 365 Insights app is built in Power Apps and is available for an easy installation on the AppSource marketplace. To install the app:

1. Go to the AppSource listing [Messaging for Dynamics 365 Customer Insights](https://appsource.microsoft.com/en-us/product/dynamics-365/infobipdoo.infobip_dynamics_insights) and click on **Get it now**.
2. Select the environment where the Customer Insights solution is deployed.
3. Wait until the installation is completed.

## Configure the app
  
In Dynamics 365, go to **Apps** and open the Dynamics 365 link. Then, select **Infobip Messaging**.

To configure the app, use the following steps:
  
### Step 1 - Give Consent [#step-1-give-consent-configuration]

1. Go to **Settings** and click **Give Consent**.
2. Use an account with **System Administrator** privilege to get permissions.

### Step 2 - API Credentials [#step-2-api-credentials-configuration]

1. Go to **Settings** and then go to **API Credentials**.
2. Click **New**.
3. On the **General** tab, add the following information:
    - Insert the name of the configuration.
    - Insert the API Key that you received from Infobip.
    - Depending on your Infobip account settings, select the delivery report settings:
       - **Use subscriptions** – enable if you plan to use subscriptions for delivery reports
       - **Use application ID** – enable if your Infobip account is not a subaccount and can use Infobip Subscriptions with Application ID
4. Click **Save**.

### Step 3 - Set as live [#step-3-set-as-live-configuration]

1. Share the **Organization Data Service Url** with Infobip to register for sending reports.
2. Click **Set As Live**.

### Step 4 - WhatsApp configuration [#step-4-whatsapp-configuration-configuration]
  
These steps describe how to configure the WhatsApp channel.

1. Go to **WhatsApp Configuration**.
2. Select **Yes** to enable the WhatsApp channel
3. Click **Save**.
4. On the **Sender** field, you see all the **Available senders**.

### Step 5 - Viber configuration [#step-5-viber-configuration-configuration]
  
These steps describe how to configure the Viber channel.

1. Go to **Viber Configuration**.
2. Select **Yes** to enable Viber channel
3. On the **Sender** field, you see all the **Available senders**.
4. On the **1-Way Viber Senders** field, you can type name and click **Add**.
5. Click **Save**.

### Step 6 - RCS configuration

These step describe how to configure the RCS channel.

1. Go to **RCS configuration**.
2. Select **Yes** to enable the RCS channel.
3. On **Sender** field, you will see all the **Available senders**.
4. On **1-Way RCS Senders** field, you can type name and click **Add**.  
5. Click **Save**.

### Step 7 - Custom channels configuration [#step-6-custom-channels-configuration-configuration]

You can configure additional channels. To configure a custom channel:

1. Go to **Custom Channels** and click **New custom channel**.
2. Select the channel that you want to add, and then click **Next**. This example describes Viber but you can repeat these steps for WhatsApp, if applicable.
3. Add a name for the channel in **Name**. You can also add a description of the channel.
4. Add a sender name in **Sender**. The sender name is displayed in Journey.
5. Select the Configuration that you created in Step 2.
6. Click **Next** and then click **Done**.

## Configure delivery reports

Depending on your Infobip account settings, there are three possible ways to define how delivery reports are sent to your Dynamics instance, depending on the options you enable.

- No options enabled in your Infobip configuration on Dynamics: the application continues using the default behavior of delivery notifications.  
- Enable **Use subscriptions**: you must manually create a subscription in your Infobip web interface.  
- Enable **Use application ID**: you must create both an application and a subscription.  

### Create an application ID

When you enable **Use application ID**, you must create an application:

1. In the Infobip web interface, go to **Developer tools > Applications and entities**.  
2. On the **Applications** tab, create a new application.  
3. For **Application ID**, enter exactly `d365-marketing`.  
4. For **Application name**, enter a descriptive value for easier identification.  

### Create a subscription

When you enable **Use subscriptions** or **Use application ID**, you must create a subscription:

1. In the Infobip [web interface](https://portal.infobip.com/login/), go to **Developer tools > Subscription management**.  
2. Create a new subscription.  
3. Enter a name for the subscription (any value), select the channel you plan to use, and then select **Next**.  
4. Select the following events: **Click**, **Delivery**, **Seen**, and then select **Next**.  
5. If you have enabled **Application ID**, select it under applications. Otherwise, select **Next** on **Set filters**.  
6. On **Notification profile**, create a new **Notification profile**.  
    - Enter a descriptive name for the profile.  
    - Paste the **Notify URL** value from your Dynamics 365 configuration.  
7. Save the subscription.  
8. Send a request to your Infobip account manager or Customer Support to set the following additional attributes to the new subscriptions:

| Additional attributes | Attribute settings |
|-------------------|-------------|
| **Pre-auth script**  | - Script name: `preauth-msdynamics3.groovy`<br/>- Auth token discriminator regex: `ResourceId":"([^"]+).+TenantId":"([^"]+)` |
| **Special report formats for all created subscriptions** | - Delivery: `delivery.ms365.stringified.v1.json`<br/>- Seen: `seen.ms365.stringified.v1.json` |

## Use the app
  
When you have installed and configured the app, you can use it to work with contact and leads, segments, add consent to phone numbers, and templates.
  
### Contacts/Leads [#contactsleads-using-the-app]
  
Create Contacts and/or Leads with phone numbers set in the fields configured in Step 4 and Step 5. You need to set all fields that will be used as Placeholders.
  
### Segments [#segments-using-the-app]
  
Infobip Messaging supports Contact and Lead types of segments.
  
Create Segments by adding members. Save the segment and click **Ready to use** on the segment.
  
### Add consent to phone numbers [#add-consent-to-phone-numbers-using-the-app]
  
Add all phone numbers you want to send message to the Active Contact Point Consent.

1. Click **Consent Center**.
2. Click **Custom consent**.
3. Add the phone number.
4. Select **Compliance Profile**.
5. Select **Purpose**(this is the same purpose for Journey Message).
6. Click **Save**.

### Create templates [#create-templates-using-the-app]

#### Create a Viber template
  
To create Viber template, use the following steps:

1. Click **Viber Templates**.
2. Click **New**.
3. Add a name for the template in Name.
4. Select if Placeholders should be taken from the Contact table or Lead table
5. Select a **Sender** from the drop down list.
6. Select **Add message tags** to add Placeholders to the message.
7. Compose the message content in **Message**.
8. Click **Save**.
9. Then, click the **Go Live** button.

#### Create a WhatsApp template
  
To create WhatsApp template, use the following steps:

1. Click **WhatsApp Templates**.
2. Click **New**.
3. Add a name for the template in Name.
4. Select if Placeholders should be taken from the Contact table or Lead table.
5. Select a **Sender** from the drop down list.
6. Select a template from list of templates assigned to selected Sender.
7. Select **Add message tags** to add Placeholders to the message.
8. In the Body Placeholders field, select which field from Dataverse to input to particular Placeholder.
9. Click **Save**.
10. Then, click the **Go Live** button.

#### Create an RCS template

To create RCS template, use the following steps:

1. Click **RCS templates** in the left menu.
2. After click, you see list of all templates, click **New**.
3. On the **General** tab, fill in the **Name** for template and choose the audience you want to target.
4. Select a **Sender** from the drop down list.
5. Toggle **Add message tags** to add Placeholders to the message.
6. Compose the message content in **Message**.
   - You can choose a **Message type** of either **Text**, **File**, **Rich Card**, or **Carousel**
   - Under each type you can add a suggested action (on Rich Card and Carousel they can also be added as buttons)
7. Click **Save**.
8. Click **Go Live**.

### Create a Journey Message [#create-a-journey-message-using-the-app]
  
To create a Journey Message, you need to embed the created templates:

1. Click **Journey Messages,** and then **New message**.
2. Select the channel for the message from drop down list.
3. Add a name in **Name**.
4. Select a Template from the drop down list.
5. Select **Purpose**. Make sure that you have added target phone numbers to the Purpose group in the Consent Center.
6. Click **Save**.
7. Click **Test send** to test a message. You input the phone number in the next step.
8. Click **Ready to send**.

### Create a Journey [#create-a-journey-using-the-app]
  
To create a Journey, click **Journeys** and then click **New journey**.

1. Add the name of a journey.
2. Select the type of journey.  Infobip Messaging supports Trigger-based and Segment-based journey.
3. Select a segment of targets from the drop down list.
4. Set when the journey should be executed.
5. Click **Create**.
6. On the **Add an action or other element** window, select **Send other types of messages**.
7. Select a Channel from the drop down list.
8. Choose a Journey Message from the drop down list. The Journey Messages are available if the particular message is targeted at a Contact or Lead table.
9. Click **Save**.
10. Click **Publish**.

The journey target segment type (Contact or Lead) has to be aligned with selected messages types (Contact or Lead). If it is not aligned, error message will be displayed and the journey will not be published.

You can check the status of sent messages after selecting it in left menu.

## Related entities, placeholders, and trigger parameters

Related entities placeholders and trigger parameters let you create highly personalized messaging campaigns across the WhatsApp, RCS, and Viber channels using **message tags**. You can access data from entities that are two relationships deep from the primary record and use journey context information, including journey details, segments, forms, and events.

### Add message tags

To add message tags for related entities placeholders and trigger parameters:

1. Open a WhatsApp, RCS, or Viber channel message template.
2. Toggle the **Add message tags** in the template designer.
3. On the **Related entities** tab, add attributes from directly related records to include that information. For example, `{{parentcustomerid.name}}`.
4. Click the **Refresh** icon next to the entity to load its fields, and select the entity from the drop-down.
5. On the **Trigger parameters** tab, browse or search for the parameters you wish to use:
   - **Journey Context**: `JourneyId`, `JourneyName`, `JourneyVersion`.
   - **Trigger Details**: `TriggerType`, `TriggerTime`, `EntityId`
   - **Segment Info**: `SegmentId`, `SegmentName`
   - **Form Details**: `FormId`, `FormName`, `FormSubmissionId`
   - **Event Info**: `EventId`, `EventName`, `EventRegistrationId`
   - **Custom Attributes**: `CustomAttribute1`, `CustomAttribute2`, `CustomAttribute3`