Before you start, be sure that you've completed the following requirements:
In this section of the guide, you'll learn how to create a Salesforce Chatter notification when you receive an inbound message.
In your Salesforce setup home page, go to the left-hand navbar and click on Process Automation > Process Builder :
On the My processes page, click the New button at the top right corner:
In the New Process panel, enter the following information:
SMS Chatter Notification
, or a custom name.
SMS_Chatter_Notification
. Press Tab to auto-populate this field.
Creates a Chatter notification on inbound SMS.
This is optional.
Now that you've created your Process Builder flow, you can configure it to create the Chatter notification.
Start by clicking on Add Object . Enter Twilio
in the Object finder and select Twilio Message as the object to trigger on:
Then, under Start the process , make sure that you've checked only when a record is created :
Now that you have your trigger set up, you need to configure the process so it only creates Chatter events when inbound messages are created.
In the diamond underneath the Twilio Message trigger, click on Add criteria . You'll see a side panel headed Define Criteria for this Action Group appear.
Specify the following values:
Set conditions:
Once you've specified those conditions, click the blue Save button at the bottom of the panel.
Now that you have a trigger and criteria set up so that your process will only execute actions for an inbound message, you can trigger different types of events within Salesforce such as email or Chatter. For this example, we'll post to Chatter.
First, click on Add action in the Immediate Actions box. Then specify the following values in the side-panel that appears:
Post to Chatter
, or a custom name of your choice.
For the message, click on Merge field and add Number Unformatted as well as Body . You should end up with the following in your message field:
New Message from {![TwilioSF__Message__c].TwilioSF__From_Number_Unformatted__c}: {![TwilioSF__Message__c].TwilioSF__Body__c}
Click on the blue Activate button in the top-right corner of the Process Builder window. Now try texting a message to your Salesforce instance. You should see new messages arriving in your Chatter group:
Alternatively, you can also post the Chatter directly to the message owner, instead of a group.
Your configuration to post a Chatter to user will be:
[TwilioSF__Message__c].Owner:User.Id
.