Map message data
To complete our integration we need to map the messages between Salesforce and Twilio and vice versa. The inbound notification from Salesforce maps to the request of the synchronous call to Twilio, the response of Twilio is mapped to the create CaseComment
callback, and a fault response from Twilio is mapped to the create FeedItem
callback.
Map Salesforce notifications to Twilio requests
Let's create the request mapping. First, click the mapping icon, in the middle of the flow, and then on the plus sign to create a new mapping. This will be a little more complex than in the previous chapter. In this test, we are going to send the SMS message to our own phone.
Since we don't receive this phone number in our notification, we need to assign the value manually or retrieve it in a separate service call. In this first iteration, we manually assign the From and To phone number and concatenate some nodes of the notification to compose the body node of the SMS message.
In the mapping...