Dynamics 365 Real-time marketing custom channel

Kieran HolmesDyn365CE1 year ago52 Views

Dynamics 365 Real-time Marketing Custom Channel

Photo by Franco Antonio Giovanella

In the realm of Outbound Marketing (OBM), marketers have long relied on Custom Channels to establish diverse and engaging communication avenues within their customer journeys. While these channels have been instrumental, their functionality has often exhibited limitations. However, there’s exciting news on the horizon! Microsoft’s Dynamics 365 has recently revamped these channels in their Real-time Marketing (RTM) module, unlocking a wealth of enhanced capabilities.

Dynamics 365’s Marketing module already offers native support for popular communication channels like Email and SMS, along with integration options for providers such as Twilio and Telesign. However, when it comes to utilizing alternative channels or providers, the need for Custom Channels arises. These channels can be utilized seamlessly alongside the out-of-the-box options within both OBM and RTM customer journeys. Yet, true to their name, customizing the system to align with specific requirements becomes essential.

While Microsoft and various blogs have already provided comprehensive documentation on implementing Custom Channels in OBM, there’s still a knowledge gap when it comes to integrating them into RTM. In this article, we will bridge that gap by providing step-by-step guidance on implementing Custom Channels within RTM, although you can certainly refer to Microsoft’s documentation, we will shed light on potential hurdles arising from UI discrepancies and misalignment with the provided instructions.

Image highlighting the actions to be selected when using channels (custom and OOTB) in Journeys.
Fig 1: Actions to select when using channels in Journeys

Create a RTM Custom Channel

In order to provide you with a comprehensive understanding of Custom Channel creation, we will draw upon Microsoft’s official documentation for RTM Custom Channels as our trusted guide. Throughout this process, we will not only highlight the key distinctions that are crucial for success but also shed light on the disparities between a standard custom channel and an SMS Custom Channel.

To illustrate the process, we will walk you through the two possible examples — we will create a standard custom channel and we will delve into the creation of an SMS Custom Channel using the popular provider, Twilio. Although Twilio is already a native option.

1,2- Define an extended configuration entity for the Channel Instance and for Channel Instance Account

To effectively represent our custom channels and their corresponding senders, as well as manage phone numbers for our SMS Custom Channel, we need to create custom entities within Dynamics 365. These entities will extend the configuration for the Channel Instance and Channel Innstace Account (SMS).

Let’s proceed with the creation of these entities:

An image of the created channel instance entities to represent our custom channels.
Fig 2: Custom Channel Instance Entities

The next step is to add a relationships between our new entities and the base channel entities (channel instance and channel instance account), but here is where things get tricky because we can not achieve this through the Dynamics 365 UI so we will need to do it manually:

To overcome this obstacle, we need to export the solution containing our custom entities as an unmanaged solution. Before proceeding, ensure that you have the Power Platform CLI installed on your computer and download the sample solution provided in Microsoft documentation.

Once the solution is exported, open a terminal window in the folder containing the exported solution and unpack it using the following command:

pac solution unpack --zipfile RTMCustomChannels_2023_01.zip --folder .RTMCustomChannels_2023_01Unpacked.
Image showing how to unpack the exported solution.
Fig 3: Solution Unpack Demonstration

Navigate to the Relationships folder within the unpacked solution and create a new XML file to represent the one-to-many relationship between the base channel instance and our custom channel instances. Follow the example provided by Microsoft’s documentation, or copy the files from the Sample Solutions provided by Microsoft and rename them accordingly to achieve the desired relationships.

Demonstration on how to create relationships for Custom Channel
Fig 4: Demonstration on how to create relationships for Custom Channel 1
Demonstration on how to create relationships for Custom Channel
Fig 5: Demonstration on how to create relationships for Custom Channel 2

Next, open each of the pasted relationship files and rename the components to align with our custom channels entities.

Demonstration on how to create relationships for Custom Channel
Fig 6: Demonstration on how to create relationships for Custom Channel 3

Finally, open the Relationship.xml file from our solution and add references to the newly created relationships. This step ensures proper association between our custom entities and the base channel entities, establishing the necessary connections for seamless functionality.

Demonstration on how to create relationships for Custom Channel
Fig 7: Demonstration on how to create relationships for Custom Channel 4

3- Define the Message Parts

When creating a custom channel, it is essential to define the message parts that will be used to send parameters specific to that channel, such as the title, subtitle, text, and more. For the SMS channel, a single message part is required, which is utilized by the default Dynamics 365 Marketing SMS editor. It’s important to note that SMS channels do not support any other types of message parts.

According to Microsoft’s documentation, manually modifying the components is necessary as this functionality cannot be achieved through the Dynamics 365 UI.

Let’s proceed with creating our message parts by modifying the Customizations.xml file from our exported solution, using the example provided in Microsoft’s documentation.

First, we will set the message parts for the standard custom channel. Take note of the following considerations while doing so:

  • Channel Message Part Id: This parameter is the GUID of the message part record that will be created by Dynamics 365 to represent our message part. Ensure that this GUID is unique.
  • Channel Definition Id: This parameter represents the GUID that uniquely identifies our standard custom channel. Save this value, as it will be used in subsequent processes.
Standard Custom Channel Message Part definition
Fig 8: Standard Custom Channel nessage part definition

Next, we will set the message part for the SMS custom channel. Again, pay attention to the following aspects:

  • Channel Message Part Id: This parameter is the GUID of the message part record that will be created by Dynamics 365 to represent our message part. Save this value for future use.
  • Channel Definition Id: This parameter represents the GUID that uniquely identifies our SMS custom channel. Save this value for future use.
  • Name and type: Since this message part is specifically for the SMS custom channel, it is required to set the name as ‘Text’ and the type as ‘192350000’.
SMS Custom Channel Message Part definition
Fig 9: SMS Custom Channel message part definition

Heads up!
It’s worth noting that Microsoft’s documentation specifies only a limited set of allowed message part types, making it impossible to include parts like numbers or option sets. However, there’s a workaround available. We can create another custom entity to store all the parameters we wish to send through our custom channel and reference it using a message part of the ‘record’ type. Later, when developing the code to handle the custom channel, we can query the record based on its GUID.

Creation of Standard Custom Channel Message entity
Fig 10: Creation of Standard Custom Channel Message entity
Standard Custom Channel Message as message part definition
Fig 11: Standard Custom Channel Message as message part definition

In the example image above, we set a record-typed message part to reference the newly created entity called “Standard Custom Channel Message.” Pay attention to the following considerations:

  • Channel Message Part Id: This parameter is the GUID of the message part record that will be created by Dynamics 365 to represent our message part. Ensure its uniqueness.
  • Channel Definition Id: This parameter is the GUID that represents our Standard Custom Channel so you should use the one already used for the previously created message part called “Standard Text”.
  • Type: Set this to the ‘record’ message type to indicate the reference to our custom entity.

By leveraging these techniques, we can effectively handle the limitations on message part types and include additional parameters in our custom channel by utilizing a separate custom entity. This approach provides flexibility in tailoring our communication channels to meet specific requirements.

Note: Skip to step 7 if you want to test what you have accomplished so far.

4- Define the localization for the admin interface

This part of the process is optional and I personally haven’t utilized it before, so I will skip it for the purposes of this demonstration.

5- Define the message editor interface

This part of the process is also optional. It allows us to “overwrite” the native Message Editor from Dynamics 365 by using a form from another entity, however you still need to define your message parts, corresponding to the attributes created in this entity so we will not be able to use other type of attribute than the ones allowed as message parts.

For the purpose of this demo, we will not be utilizing this optional step. However, I can provide you with a quick overview of how to implement it:

  1. Begin by creating a new entity in Dynamics 365.
  2. Define the necessary columns/fields within this new entity to represent the attributes you want to use for message editing.
  3. Additionally, create an attribute called “placeholders” within the entity.
  4. Edit the main form of the newly created entity to design the desired message editing interface utilizing the created columns/fields.
  5. For each attribute created, add a corresponding message part. Ensure that the message part name matches the attribute’s schema name, excluding the prefix. For example, if you have a column named “cap_text,” create a message part with “msdyn_displayname” set as “text.”
  6. In the final step of this demonstration (step 7), where we will define your channel definition, set the “msdyn_messageformid” parameter to the GUID of the form you created in the previous step.

It’s worth noting that if you plan to add client-side logic to this form, Microsoft currently only allows it to be added via web resources, not through business rules.

6- Define Custom APIs

This step is where you will be building your custom code to stablish seamless communication between Dynamics 365 and your selected providers, leveraging the power of Dynamics 365 Custom APIs. To gain a comprehensive understanding of creating a Dynamics 365 Custom API, I recommend referring to the official Microsoft Documentation or exploring other informative blog posts dedicated to this specific topic. As this blog post focuses on a different aspect, we won’t delve into the detailed steps of API creation.

Essentially, you will need to create an Outbound custom API that will be invoked during the Marketing Journey runtime. This API will receive message parameters, transmit them to the intended recipients (customers), and respond to the Journey with a status of “Sent” or “Not Sent.” In addition, you might find it necessary to develop a Delivery Report custom API, which informs Dynamics 365 about the delivery status of messages sent through the Outbound custom API (“Delivered” or “Not Delivered”). Depending on your requirements, if you are implementing an SMS Custom Channel with inbound messaging capability, you can create an Inbound custom API to enable the communication between your provider and Dynamics 365.

For this demo we will only create an Outbound custom API to quickly show you how you can achieve it.

For the purpose of this demonstration, we will focus solely on creating an Outbound custom API to provide you with a quick overview of the implementation process. Let’s begin by developing our Custom API and deploying it to the designated environment using the Plugin Registration tool. To assist you in the coding process, I recommend exploring Microsoft’s sample solutions (downloaded in a previous step) and adapting them to suit your specific needs.

Microsoft’s Outbound Custom API example
Fig 12: Microsoft’s Outbound Custom API example

Next, we need to create the Custom API component within the environment and establish the necessary associations with the previously created plug-in:

Custom API creation
Fig 13: Custom API creation

Lastly, it’s essential to define the Custom API’s request and response parameters, linking them to the corresponding Custom API that was created previously:

Custom API request parameter creation
Fig 14: Custom API request parameter creation
Custom API response property creation
Fig 15: Custom API response property creation

7- Define the Custom Channel

We have reached the final step of configuring our Custom Channel, which involved creating the Custom Channel Definition. This definition serves as a consolidated record within the Channel Definition entity, enclosing all the previously established components. It is important to note that this step requires manual modification of the solution components, specifically the Customizations.xml file of your solution.

To create the Channel Definition for our SMS Custom Channel, we can utilize the sample provided by Microsoft and customize it to suit our needs. While doing so, please consider the following points:

  • Channel Definition ID: This parameter must correspond to the GUID defined in the corresponding Message Part that was defined earlier.
  • Channel Definition Account External Entity: This should match the name of the Custom Entity created to represent the Channel Instance Account.
  • Channel Definition External Entity: This should match the name of the Custom Entity created to represent the Channel Instance.
  • Channel Definitions External Form ID: Set this parameter to the GUID of the form associated with your custom entity. You can retrieve the GUID by navigating into your solution and to Entities -> Your Entity -> FormXml -> Main -> Copy the name.
  • Outbound Endpoint URL Template: Ensure that this parameter matches the name of the Outbound Custom API created in the previous step.
  • Message Form ID: For demonstration purposes, this parameter is included here, however, it will be removed since we do not want a Custom Message Editor Interface as discussed in step 5 of this demo.
  • Channel Type: Ensure you set your channel type to thre right one: SMS
Custom Channel definition creation
Fig 16: Custom Channel definition creation

For the Standard Custom Channel, a separate Channel Definition needs to be created, excluding the parameters required for defining the Channel Instance Account.

Wrap it all up!

Congratulations on successfully completing all the necessary steps to configure your Custom Channel! Throughout the process, you had the freedom to update the solution version by modifying the solution.xml file, repackaging the solution, and importing it back into the environment to thoroughly test the newly created components by using the following pack command:

pac solution pack --zipfile RTMCustomChannels_2023_02.zip --folder .RTMCustomChannels_2023_01Unpacked.

Test things out in the Dynamics 365 Marketing Module

To finish configure your SMS Custom Channel, begin by navigating to the Settings area of your marketing module. Within the Settings area, you will find the SMS Providers and Custom Channels sub-areas.

Start by configuring the SMS Custom Channel in the SMS Providers sub-area. Click on “New” and select your custom channel from the available options.

Next, access the settings of your custom channel. Populate the Name and Description fields as required. If you need additional details specific to the Custom Channel, such as a Communication Key for connecting with the channel provider, you can create a corresponding column in the Channel Instance Account custom entity. In this case, it would be the SMS channel instance account. Ensure that you add this field to the form referenced when defining the Channel Definition in Step 7.

Modifying Sms Channel Instance custom enttty form
Fig 16: Modifying SMS Channel Instance custom enttty form
Show modifications on Sms Channel Instance form
Fig 17: Show modifications on SMS Channel Instance form

After configuring the settings, proceed to set up the Phone Numbers for your Custom Channel. This feature is especially useful if you have multiple phone numbers for sending SMS to your customers. By default, you need to specify the Phone Number and Name for each entry. Similarly, like before, you can add more details by modifying the SMS Channel Instance form.

Show modifications on SMS Channel form
Fig 18: Show modifications on SMS Channel form

You can follow a similar approach to configure your Standard Custom Channel within the Custom Channels sub-area, however you won’t find any phone numbers to be configured.

To test and utilize your channels, navigate to the Real-Time Marketing area. Here, you can create messages for your Custom Channels under the “Text Messages” and “More Channels” sections. You have the option to test these messages by clicking the “Test Send” button or incorporate them into a Journey.

Text Message creation
Fig 19: Text Message creation
Demonstration on using Text Message in a Journey
Fig 20: Demonstration on using Text Message in a Journey

Additional details

  • Dynamics 365 Marketing utilizes the Marketing service special user, typically named “Dynamics Marketing Customer Experience Platform PROD,” to execute the Outbound Custom API plugin. If you require access to custom entities within your plugin, you will need to grant additional privileges to this user. One way to accomplish this is by extending the “Cxp Channel Definitions Services User” role, which is assigned to this user.
  • When using your Custom Channel within a Journey, you may encounter situations where you need to use different types of attributes as the “Send To” criteria. To address this, you can navigate to the Settings area and access the Audience configuration. From there, you can configure the settings to accommodate your specific requirements:
Demonstration on how to add attributes to send messages in a Journey
Fig 21: Demonstration on how to add attributes to send messages in a Journey
Demonstration on how to add attributes to send messages in a Journey
Fig 22: Demonstration on how to add attributes to send messages in a Journey 2

Summary

At Capgemini, our passion lies in leveraging the full potential of Microsoft services and exploring the latest offerings. We are dedicated to sharing our knowledge and expertise through informative demos and tutorials. We believe that this demo/tutorial will greatly assist you in implementing custom solutions to effectively communicate with your customers.

We highly value your feedback and welcome any suggestions for improvement. Our goal is to continually enhance our content and deliver the most valuable and practical insights to our readers. Together, let’s embrace the power of Microsoft services and unlock new possibilities in customer communication.

Feel free to provide your feedback and share any areas where you believe we can further optimize and enhance our solutions. We appreciate your engagement and look forward to your valuable input!

We are looking for Dynamics 365 Finance and Operations professionals, plus other Microsoft Business Applications and Azure skills. If you’d like to hear more, please view our open roles.


Dynamics 365 Real-time marketing custom channel was originally published in Capgemini Microsoft Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.

Original Post https://medium.com/capgemini-microsoft-team/dynamics-365-real-time-marketing-custom-channel-ab59a2547922?source=rss—-333ebfdadb74—4

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
April 2025
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30     
« Mar   May »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...