Create a Salesforce Site with the URL path suffix
Create a Salesforce Site with the URL path suffix
Provide access to SMSWebhookHandler class
Go to your Twilio dashboard :
Develop → Explore Products → Super Network → Phone Numbers → Manage → Active Numbers
Configure this endpoint under Messaging Configuration > A message comes in :
{Site_Url} /{Path_Prefix} /services /apexrest /WatBox_SMS /api/update /sms /status
S.No | Field Name | Value |
---|---|---|
1 | Provider | Twilio |
2 | From No. | Registered phone number with Twilio |
3 | Target Object | Account / Lead / Contact / Custom Object |
4 | Custom Object Name | API Name of the Custom Object when the Target object is selected as Custom Object |
5 | Contact Relationship Field | API Name of the Contact Relationship field name when the Target Object is selected as Custom Object and that Object doesn’t have the Phone Number Field in it. |
6 | Phone Number Field | API Name of the Targeted Phone Number field in the Target Object or the Phone Number field in the Contact object when the Target Object is Custom object and that doesn’t have a phone number field in it but has relationship with Contact. |
7 | Formatted Phone Field | API name of another phone field in the Target Object (Optional) |
8 | SMS Chat Message Relationship Field | API name of the relationship field with the Custom Object in SMS Chat Messages object when the Target object is Custom object then create relationship field with that Custom Object in SMS Chat message and provide the name in it. |
9 | OwnerId | Provide a user Id or a queue Id. That will be the owner of the new records which will get created when a new inbound received without matching with any records. |
10 | SMS Opt Out Keywords | Mention the keyword here like Stop, Cancel, Unsubscribe and Not Interested. When an Inbound received with a message mentioned here then that will be considered as SMS Opt out. NOTE: Please provide comma separated values. Don’t provide blank spaces after the element. Expected way: Stop,Cancel Don’t provide as below: Stop, Cancel |
11 | Stop Bulk SMS Batch | This will act as a switch to control the Bulk SMS Batch. If this checkbox is checked then Bulk SMS won’t work, all the schedule messages won’t get sent. |
12 | Bulk SMS Batch Interval | By default the Interval is set as 15 mins. It can be changed and need to schedule the batch according to this using the script provided in the doc below. |
13 | Is Template Available | Mark this checkbox when the SMS Templates are there. |
Visual reference included
Important Note : For custom objects with phone fields, create a field SMS_Opt_Out__c.
Create Named Credentials for Twilio & Bitly
Assign access to external principal
In Allowed Namespaces for Callouts, add: WatBox_SMS
Update Business Phone Number
Enable SMS Bell Notification
Place the CreateSMS custom component in record detail pages
Ensure SMS templates exist for Lead/Contact
Add Send Bulk SMS button to list view
Ensure template exists for Campaigns
Add SMS Template field in Campaign page layout
Execute the below Apex script :
System.schedule('Scheduled Job 1', '0 0 * * * ?', new WatBox_SMS.BulkSMSBatch());
System.schedule('Scheduled Job 2', '0 15 * * * ?', new WatBox_SMS.BulkSMSBatch());
System.schedule('Scheduled Job 3', '0 30 * * * ?', new WatBox_SMS.BulkSMSBatch());
System.schedule('Scheduled Job 4', '0 45 * * * ?', new WatBox_SMS.BulkSMSBatch());
Please fill out the quick form and we will be touch
with lightning speed.
Start with a 30 day trial for you to taste the CRM + WhatsApp interactions!