Omnichannel for Customer Service – Outbound Messages (SMS)

We now have the capability in Microsoft’s Omnichannel for Customer service to commence outbound conversations with our customers using SMS, WhatsApp and Twitter. In this post I will give an example of how we’d configure an outbound SMS. (In later posts I plan to cover WhatsApp and Twitter.)

You can read all about the outbound capabilities in Microsoft’s documentation here.

The overall concept is that we create an outbound message template, enable outbound messaging on a given channel and then create a Power Automate Flow that will send the message. Plus the message template can include dynamics values which can be provided by the Flow, an approach that allows us to personalize the outbound message.

When describing a feature I tend to like to show an actual example of how I’ve configured it. The Microsoft documentation describes a common scenario of sending a message when a case is created or resolved. They even include example Power Automates that you can download and amend. These will be common uses of outbound messages and I do suggest you review their examples.

In the interest of showing something different I have decided to use a different example … this will be based on a proof of concept I created for a real scenario!

My use case was a little different! I wanted to generate an SMS to someone when a conversation request arrived into Omnichannel. Why??? …. Well in my scenario we wanted to alert someone with that a fresh conversation had started. Maybe you have someone on out of hours support who needs to monitor incoming conversations on a particular channel. If the volumes are low we can’t expect them to be glued to the screen 24/7, so having a “nudge” from an SMS might be useful.

This does mean that my example is a little more specific than those mentioned in the Microsoft documentation. But actually the steps involved are pretty much the same. Those being;

  1. Create a message template
  2. Configure outbound messaging
  3. Create a Power Automate to send the message

Tip: If a customer receives an outbound message. If / when they reply to that message they’d effectively commence an inbound conversation with one of your agents. Imagine, for example, that you send them an outbound message saying “Your delivery will be at 10am tomorrow”. They could reply explaining they wouldn’t be at home tomorrow etc. So my tip is, when considering outbound messages you might want to consider the full customer journey. As the outbound message may just be the start of the conversation with your customer.

Step One – Create a message template

Below you can see that I have opened my Omnichannel Administration app and within this located the messaging templates option. Within here you will see any existing templates, which you can amend. Or you can use the “+ New” option to create new templates.


Below you can see my example message template. It is a pretty simple message!

All I have done is given my template a name and picked the channel. SMS, in this example.

Next I enter the text for my message. Notice that I have entered “{Myname}”. Anything between the brackets will be substituted for dynamic information by my Power Automate. We’ll see how that works later in this post!

Tip:
My example is pretty simple in that I am only going to send the message in English. Notice that I could create multiple versions of the message with localised text if I wanted to implement to multiple languages.

Step Two – Configure Outbound Messaging

Now I have my outbound template I am ready to configure my outbound channel to use that template. Below you can see that in the Omnichannel Administration app I have located the “Outbound” option. Within this we can see my existing outbound configurations. You can edit those from here or use the “+ New” option to create a new one.

I actually have two providers of SMS defined! Telesign and Twilio. So in my example I have created both as I wanted to test working with either of my two SMS numbers. But each of these will leverage the same outbound template. Hopefully you can see that this gives you flexibility if you happen to have multiple SMS numbers defined. (Or WhatsApp and Twitter accounts if you wish to send outbound messages using those channels.

Below I have shown one of my outbound configurations.

Notice the configuration ID. This is generated when I save the configuration. You will need to copy this as we’ll use it within the next step of creating a Power Automate Flow to send the outbound messages.

Also notice that I have selected the SMS channel and also picked which channel I want to use. Plus I have linked this configuration to the message template I created in the first step.

Importantly notice the “show in timeline” option. In my scenario I just wanted to send out the message and didn’t need it to show in the timeline of any related record. So I entered “No”.

In other scenarios you will want to link the outbound message to an associated case or other entity. If you need this enter “Yes”. But having done that you will also need to provide details of the regarding “object” in the Power Automate that we will create in the next step.

Step Three – Create a Power Automate to send the message

Now my Outbound message has been defined I needed to create a Power Automate to send the message. You could trigger the message in many ways … for example when a case is created. But in my example I will trigger the Power Auotmate when a conversation in Omnichannel is created.

I have shown the steps in my Power Automate below. I will then expand on each of these below. At a high level the actions in my Power Automate are as follows;

  1. Conversation (Created) …. As explained my Power Automate is triggered when a conversation is created.
  2. Initialize (ContactList) …. Firstly I initialize an array. At this point it will be blank but later we will add the contact you will receive this message.
  3. Get (NeilParkhurst Contact) … I added this step to query the contact I wanted to send the message. (If you has a case maybe you’d read details for the customer associated to the case!)
  4. Append to array variable … Having queried my contact I add details for the message to my array.
  5. Compose (JSON) … next I format my array as JSON, as required by my next step.
  6. Unbound action (Send SMS) … My final step is to trigger an action to send the SMS.

In the following sections I will detail exactly how I defined each of my Power Automate actions.

Conversation (Created)

My first tile is pretty simple. Here I am simply saying that the Flow is triggered on create of a “Conversation”. In my final production version I may have wanted to use the advanced options to filter which conversation. Or maybe I would have followed this step with a condition to check if I wanted to send the SMS. But this was a simple proof of concept, so I simply trigger my Flow for every conversation that is created.

Initialize (ContactList)

Here I am simply initializing an array variable which will be called “ContactList”. I will use this later in my Flow.

Get(NeilParkhurst Contact)

In this next step I am running a query to get the contact that I want to send the message. (As I need to find their mobile number!)

Again keep in mind that this is a simple proof of concept example. As I have queries the contract directly from the ID of my contact. You will probably want to do something more creative to find the contact or contacts that need to receive this message.

Append to array variable

Here I am adding details of my contact into the array. Specifically I am defining the mobile phone number to use for my message.

Also notice that under context items I have set a variable called “Myname” to the first name of my contact. If you recall in step one I included “Myname” in my message template. Meaning at runtime the contacts name will be inserted into my templte.

I have shown the value for my append action below;

{
  "tocontactid": "@{outputs('Get(NeilParkhurst_Contact)')?['body/mobilephone']}",
  "channelid": "sms",
  "optin": true,
  "contextitems": {
    "Myname": @{outputs('Get(NeilParkhurst_Contact)')?['body/firstname']}
  }
}

Note:
If earlier you’d selected the option to add the message into the timeline. In this contextitems section you’d need to include the “regardingobjectid” and “entityrealtionshipname” for the regarding table. If you are doing that you might want to review the example in the Microsoft documentation I referenced at the start of this post.

Compose (JSON)

The next action simply composes my array ready for use.

Unbound action (Send SMS)

My final action sends the message. You create an unbound action and enter the name “msdyn_InvokeOutboundAPI”.

Next we add the ID of your outbound configuration. (This is the ID from the outbound configuration which I commented you needed to copy in the previous step!)

You need to add the ID into a field called “msdyn_ocoutboundconfiguration msdyn_ocoutboundconfigurationid”.

Tip: I made an mistake at this point!!! As you can see from the screen shot below the names wrap and I couldn’t easily read the entire name. Therefore you need to be really careful that you assign the ID to the correct field as there are several with very similar names!

My final setting is to add the output from my “Compose (JSON)” action into the ContactList for this unbound action.

Once my Power Automate was turned on I began to receive text messages every time a new conversation arrived into Omnichannel. Honestly, this might not be the best example in the world! But I hope you can see that the overall concept is pretty straight forward and you could amend my idea for many situations.

Meaning the resulting solution is actually very flexible and pretty simple to implement. Enjoy.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s