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.
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:
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.
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.
Next, open each of the pasted relationship files and rename the components to align with our custom channels entities.
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.
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:
Next, we will set the message part for the SMS custom channel. Again, pay attention to the following aspects:
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.
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:
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:
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.
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.
Next, we need to create the Custom API component within the environment and establish the necessary associations with the previously created plug-in:
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:
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:
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.
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.
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.
Additional details
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.