Mercury SMS provides SMS Opt Out fields on some standard objects. You can expand this logic to any other standard or custom object within Salesforce.
Add an Existing Opt-Out Field to a Page Layout
The Lead, Contact, Opportunity, and Case objects come preset with SMS Opt Out fields. Add the existing field to page layouts in order to use them.
1. Navigate to the desired page layout.
2. In the top menu, find the field SMS Opt Out - if the field isn't there, you may need to create the field.
3. Drag the field to the desired location in the detail section of the page layout.
4. Save the page layout.
For more detail on working with page layouts, see this Salesforce article.
Create an Opt-Out Field on Another Object
When an inbound message is received containing the keyword STOP, the checkbox for SMS Opt Out field across any related object will be updated to TRUE. This prevents sending any further outbound messages to that record.
1. Create a new field on the desired object with the following configuration:
- Type: Checkbox
- Field Name: SMS Opt Out
- API Name: SMS_Opt_Out__c
2. When prompted, add the field to all relevant page layouts.
For additional information on creating custom fields on objects, see this article.