Configure outbound messaging
Applies to: Dynamics 365 Contact Center—embedded, Dynamics 365 Contact Center—standalone, and Dynamics 365 Customer Service
Outbound messaging enables organizations to send messages to their customers through supported channels, based on system-triggered or user-defined events. You can configure message templates for SMS and WhatsApp channels only.
As an administrator, you can do the following tasks:
- Create message templates that can be adopted for outbound messages.
- Configure outbound messages to be sent for events that are triggered for an entity, such as creation of a case.
- Configure outbound messages to be sent manually based on nonsystem events, such as a shipping delay due to weather.
Prerequisites
- Provision channels that you want to use in your environment.
- Configure the SMS channel using Twilio or Azure Communication Services to send outbound messages through SMS.
- Configure the WhatsApp channel by using a Twilio account to send outbound messages through WhatsApp.
- You must have a Power Automate account.
Set up message templates
Set up templates to send outbound messages. To create a template, consider the scenarios that require your organization to send outbound messages.
Sign in to the Customer Service admin center or Contact Center admin center app.
Create a template for your outbound message.
Important
On April 1, 2025, the WhatsApp Template Console Tab and Templates API will be deprecated. To create new WhatsApp templates, you must use the Content Template Builder.
Before April 1, 2025, we recommend that you complete the following actions to avoid service disruptions:
- Migrate your existing WhatsApp templates to the Content Template Builder in Twilio.
- In either the Dynamics 365 Contact Center or Customer Service admin center app, update your WhatsApp message templates to use Content Template SID instead of Template Name.
- If you're using an active outbound flow, update your previously created template.
Currently, each content template set can have one language only. If you want to use the same template in multiple languages, you must create a separate content template for each language. For more information, refer to Create a content template.
Set up outbound configuration
You can set up the outbound configuration in the Customer Service admin center or Contact Center admin center app.
In the site map, select Customer Settings in Customer support. The Customer settings page displays.
In the Outbound section, select Manage. The Active Outbound Configurations page displays.
Select New, and then on the New Outbound Configuration page, enter the details for the settings mentioned in the following table.
Field Description Sample value Name Name of the outbound configuration Examples:
Case created
Case updated
User addedShow in timeline The Show in timeline field displays the outbound message in the customer's timeline and activities. Set the toggle to Yes for event-based messages that apply to the support journey of a specific set of customers. For bulk messages that need to be sent to a high volume of customers, we recommend that you leave this setting at No to conserve resources in your Omnichannel for Customer Service environment and storage. Yes Channel type Name of the channel for which the configuration is being set up. SMS or WhatsApp Channel Channel number For SMS, this setting is the preconfigured channel number.
For WhatsApp, this setting is the preconfigured phone number.Message template Name of the template Your previously created template The Configuration ID is generated when you select Save. Use it later to identify this outbound configuration when you set up the flow in Power Automate.
You can choose a message template for the outbound message. The default message language and other localized message versions are part of the message template configuration and apply to outbound messages.
Set up a Power Automate flow
Power Automate provides a low-code platform for workflow and process automation. Outbound messaging in Omnichannel for Customer Service relies on flow-based business logic. Learn more in Power Automate documentation. You can download and import the following sample flows to get started:
Case Creation flow - SMS (.zip file): This template sends an automatic outbound message when a case is created.
Case Resolved flow - SMS (.zip file): This instant-type template sends an outbound message manually to all customers who have a case in the resolved state.
To set up a Power Automate flow
In the site map of Customer Service admin center or Contact Center admin center, select Productivity in Agent experience. The Productivity page displays.
In the Message templates section, select Manage. The Message template view page displays.
Select Flow at the top of the screen, and then select Create a flow.
or
Go to https://us.flow.microsoft.com/, sign in to your account, and then select My flows.
In Power Automate, set up a flow that aligns with your outbound messaging scenario:
Automated: Send an automatic message triggered by a system event, for example, case creation.
Instant: Send a message manually about a nonsystem event, for example, a shipping delay or a sale on products.
Scheduled: Send a message at a point in time, at one or more times, or after an amount of time that you specify.
Learn more about the current limits and configuration details for flows in Limits and configuration in Power Automate.
Initialize an OutboundConfigurationId variable, and then set it to the outbound message configuration ID that you generated.
Initialize an ActivityRelationship variable, and then set it to the relationship name of the entity that the activity will be linked to. For example, incident_msdyn_ocoutboundmessages. This action enables outbound activity tracking and reporting in Omnichannel for Customer Service.
Initialize a ContactList array variable, which is used to store contact information and other parameters that the system uses to send the outbound notifications.
Get the required customer contact records that contain phone numbers and other contact details, which can be used as slugs in outbound messaging.
Fill in the values for the ContactList in the Append to array variable template.
Field | Requirement | Description |
---|---|---|
tocontactid | Required | The customer's phone number that the outbound service uses to send messages. |
optin | Required | The customer's preference to be contacted by phone. This field can be set to true or false. |
locale | Optional, SMS channel only, chosen by default. | Enable dynamic message languages, by replacing the default variable with a locale column reference, such as the customer's preferred language. If the locale value is missing, the fallback locale in the omnichannel message template is applied. |
contextitems | Optional | Contains values to be processed with individual messages as they're sent. |
entityrelationshipname | Optional | This field refers to the ActivityRelationship variable that was previously defined. Although this field isn't required, it's essential for being able to track outbound activities in the timeline. So, if Show in timeline in the outbound configuration is set to Yes, this field has to be added to the flow for it to show in the timeline. |
regardingobjectid | Optional | The identifier of the object to be linked to the entity defined by the entityrelationshipname property. if this field isn't included and Show in timeline is enabled, the record won't show in the timeline. |
msdyn_ocoutboundconfigurationid | Optional | This field refers to the OutboundConfigurationId variable that was previously defined. |
customParameterName, customParamaterValue | Optional | Additional key value pair parameters for the template. These values are replaced in the message template when the message is sent. If you're using SMS or WhatsApp text messages, you add key value pairs. Don't include parameters in scenarios where if you're using WhatsApp content builder templates, Twilio WhatsApp template builder parameters should be specified in the templateparameters property described later in this table. |
sendastemplate | WhatsApp only | Set to true for new or upgraded templates in the Twilio Content Template Builder. Do not include if you're not using Twilio WhatsApp templates. |
templateparameters | WhatsApp only | List of index value pairs (if any) to be replaced in the message as defined in the WhatsApp template. |
Sample JSON for WhatsApp templates:
{
"tocontactid": @{outputs('Get_Contact_record')?['body/mobilephone']},
"optin": @{not(outputs('Get_Contact_record')?['body/donotphone'])},
"contextitems": {
"msdyn_ocoutboundconfigurationid": @{variables('OutboundConfigurationId')},
"regardingobjectid": @{outputs('Get_Contact_record')?['body/contactid']},
"entityrelationshipname": @{variables('ActivityRelationship')}
},
"sendastemplate": true,
"templateparameters": {
"1": @{outputs('Get_Contact_record')?['body/firstname']}
}
}
Sample JSON for SMS:
{
"tocontactid": "@{outputs('Get_record')?['body/mobilephone']}",
"locale": "@{outputs('Get_record')?['body/mspp_userpreferredlcid']}",
"optin": @{not(outputs('Get_record')?['body/donotphone'])},
"contextitems": {
"regardingobjectid": @{triggerOutputs()?['body/incidentid']},
"entityrelationshipname": @{variables('ActivityRelationship')},
"msdyn_ocoutboundconfigurationid": @{variables('OutboundConfigurationId')},
"sampleParameter1": "sampleValue1",
"sampleParameter2": "sampleValue2"
}
}
- Add a Perform an unbound action, select msdyn_InvokeOutboundAPI as the action name, and then set the msdyn_ocoutboundconfigurationitem/OutboundSettingsRecord/msdyn_ocoutboundconfigurationid property to the OutboundConfigurationId you previously defined. Also add the output from the compose action.
When the customer responds back to the outbound messages, the customer's message is treated like any other incoming conversation that exists today in Omnichannel for Customer Service. The conversation is routed and assigned to a customer service representative, who can then respond back to the customer.
Note
Outbound messaging imposes limits of 100 contacts per request and 30,000 requests per org per hour. Where higher loads are expected, we recommend that you implement batch processing logic in flows to limit contacts per request to 100.
Update a previously created Twilio template
Before you begin, make sure that you migrated your templates to the Content Template Builder in Twilio.
- In the site map of Customer Service admin center or Contact Center admin center, select Workstreams, and then go to your WhatsApp Twilio workstream.
- Select Edit. The WhatsApp workstream page displays.
- Select the Behaviors tab, and then under WhatsApp-approved message templates, select the template you created previously, and then select Edit. The Edit message template page displays.
- In Name, replace the name with the Content Template SID in Twilio Content Template Builder. The Content Template SID is the unique identifier for the template in Twilio.
- Select Save.
- Edit the flow that uses the template in Power Automate, and update the Append to ContactList variable action with the new WhatsApp template format described previously in this section.
Related information
Create message templates
Channels in Omnichannel for Customer Service
Configure an SMS channel for Twilio
SMS FAQ