Integrating Twilio Web Service with D365 CRM Online to send SMS Messages - CloudFronts

Integrating Twilio Web Service with D365 CRM Online to send SMS Messages

Disconnected systems cause your business processes to be inefficient. How quickly can you get new products up on your eCommerce store? How long does it take you to update inventory counts? When these processes are too slow, it negatively impacts your performance. You can’t keep up with your competitors.

Overall, these issues can lead to poor customer experience. You won’t be able to process orders quickly enough or give customers the accurate information they need to make a purchase.

Coordinating with CRM NAV integration permits you to consequently synchronize information between your ERP and different frameworks. You don’t need to contact any catches. You get the opportunity to characterize rules on how information is shared by your operational needs.

Introduction:

SMS Messages can be sent from a D365 CRM Online to an individual using the Twilio Web Services. In this blog, we will see how can we send SMS Messages from CRM using Twilio Web Service

Scenario:

We will create a message record from CRM which on save will call the Twilio web service via a plugin and send the message to the destination based on the information passed to Twilio from the D365 CRM.

Process:

Step 1: Creating Entities

Create the following 2 Entities which are ‘SMS Configuration’ and ‘SMS Message’. The SMS Config entity will only consist of three fields which are

  • Username which will have the value of ‘Account Sid’.
  • Password which will have the value of ‘Authentication Key’.
  • From which will have the value of Twilio ‘Account Phone number’.

The SMS Message entity will consist of the following two fields which are as follows

  • To which will have the value of the ‘Receiver’s Phone number’.
  • Message Body which will have the value of the ‘Message text’ that the receiver will receive.

 **Note: The purpose is to provide dynamic data and to not hardcode any value.

Step 2: Creating Plugin Code to Call the Twilio Web Service

The plugin code will be consisting of two main code blocks:

  1. Web Service Code Block
  2. Main Execute Code Block

Web Service Code Block
We will be using the Web Service code in our plugin code while calling the Twilio Web Service from CRM. For more information on how to call Web Service using plugin refer the following link : https://www.cloudfronts.com/call-web-service-plugin-dynamics-crm/

In this case we need to make modifications to the Web Call Service function block of the Web Service plugin code.

  • Changes made to the ‘Try Block’ of the Web Service Call.

  • We won’t require to make any changes to the WebClientEx code block of the Web Service Call Code.


Main Execute Code Block

  • In the Main Execute Code Block we will be calling the above Web Service Code Block.
  • Retrieving of the SMS Configuration Record can be done using fetch XML method.

Conclusion:

Thus, in this way we can send SMS Messages from D365 CRM Online using Twilio Web Services. Hope you find this helpful.


Share Story :

Secured By miniOrange