I'm busy working on my blog posts. Watch this space!
Forwarding A Copy of an Incoming Message
July 25, 2019
We are often asked if it is possible for Salesforce users to receive a copy of incoming text messages on a user’s personal or company issued cell phones. While QMan is great for capturing incoming text messages within Salesforce, customers are sometimes concerned that an important incoming text message may be missed if the Salesforce user is away from their desk.
The short answer to this is yes, it is possible to do this!
In fact, there are multiple ways to accomplish this:
1.Use the tools provided by Twilio. You can use the tools in your Twilio account to forward a copy of the message to additional numbers in addition to sending the message to your Salesforce org. Twilio has a number of tools to do this. I will not go into details here about this method of forwarding a copy of a message, but you can check out some of the Twilio guides on this topic like this one.
One thing to keep in mind if you are going this route is that if you have multiple Salesforce users that are going to be receiving copies of the incoming messages, you will need to figure out how to differentiate one incoming message from another so that you know which Salesforce user to forward the copy to. If all of your Salesforce users are sharing one Twilio phone number, then this may be difficult as all incoming messages will be sent to that single number.
2.Use QMan Text 2 Case and QMan SMS Notifications. This method lets QMan Text 2 Case do the job that it was created to do, create cases from incoming text messages, and then uses QMan SMS Notifications’ integration with Salesforce Process Builder to forward a copy of the message to the right Salesforce user. The rest of the post will walk you through how to set this up.
Step 1: Set up QMan Text 2 Case
If you have not set up Text 2 Case yet, follow the configuration guide downloaded from the QMan SMS Hero AppExchange page to get it set up. If you are already using Text 2 Case, then you are good.
Before moving on to the next step, there are a couple things to think through. First, what are your company’s requirements for which Salesforce user will receive the copy of the incoming message? You will need some way of associating that Salesforce user with the case that is created.
Let’s say, for example, that we want to send a copy of the message to the owner of a contact if that contact sends a message in. Ok, that is simple enough! When QMan Text 2 Case creates a case from a text message, it will use the incoming message’s phone number (the “from” number) to look up a contact and then automatically associates that contact to the case. Since the case created is associated with the contact that sent the message, we will be able to get the information of the contact’s owner to send the message copy to.
Step 2: Create a Process Builder entry with a QMan SMS Notification action
The next step is to create the Process Builder entry that will forward a copy of the incoming message to the associated contact’s owner. For the purposes of illustration, we will keep this example very simple. Your process may be much more complex depending on your business requirements.
Below is the general outline of Business Process that we will create.
Look at the attributes of the first box label Case. It simply state that when a new case is created, start the process.
The next step in the process, the diamond, is the criteria that must be met in order to forward a copy of the message.
In our example the criteria is very simple. If the qman__Txt2CaseToNumber__c field is not null, fire the action.
The Txt2CaseToNumber field on the Case object was created when the QMan SMS Hero package was installed and holds the Twilio phone number that the contact sent the message to. For our process, if there is a value in the field, it means that the case was created by QMan Text 2 Case and is therefore a result of an incoming text message.
You can add additional criteria here as needed based on your business requirements.
The final step is to fire the QMan SMS Notifications action that will forward a copy of the message to the correct Salesforce user.
The type of action is Apex Class, then select QMan SMS Notifications from the drop down. There are two required variables that will need to be filled out, Message Text and To Number.
For the To Number variable, we traverse the object association from the case, to the case’s contact, to case contact’s owner. We will send the copy of the message to the owner’s mobile phone, which is the mobile phone field on the Salesforce user record. So the To Number variable’s Type will be Field Reference and the Value will be [Case].Contact.Owner.MobilePhone.
For the Message Text variable field, we are going to select Formula and then click on the Value field to open up the formula editor. In order to make the copy of the message to the contact owner as informative as possible, we are going to enter a combination of text and fields. This will allow us to indicate the name and phone of the contact that sent the message. The full text message that the contact sent in will be inserted in the Case Description field by QMan Text 2 Case.
Click the Use this Formula button, activate the process, and test it out by sending a text message to your Twilio phone number. If everything is set up correctly the contact owner should see a message similar to this:
Keep in mind that the message that the contact owner receives will be coming from your Salesforce org’s Twilio phone number, not the contact’s phone number. This is the reason that we included the contact’s name and phone number in the copy of the message.
That is it! Your contact owner’s will now receive a copy of each message that is sent in that creates a case. As stated before, your requirements may require your Process Builder criteria to be much more complex. But you now have a starting point for your process.