The problem
GDPR + users that don’t check contact preferences, does not a happy prospect make (and could have some pretty serious consequences).
Salesforce natively provide us with the standard fields ‘Do Not Call’ and ‘Email Opt Out’ but if your org is anything like mine, these fields tend to end up at the bottom of the Lead or Contact page, lost in a ‘Marketing Preferences’ section that the sales team definitely forget to check before making calls…
‘Email Opt Out’ is especially cool as it stops you from sending mass emails to a Lead or Contact when this option is ticked. However, it does not prevent users from sending individual emails from Salesforce. There is an idea you can vote on to change this and it suggests this functionality is coming really soon!
It would be great if we could come up with a way to highlight contact preferences on the page layout that our users couldn’t possibly miss…
Prerequisites
👉 Make sure the fields ‘Do Not Call’ and ‘Email Opt Out’ are visible on the page layout!
If you cannot see these fields please follow these instructions (you should do this for both Leads and Contacts):
- Go to Setup > Object Manager > {Object} > Fields & Relationships
- Click on the ‘Do Not Call’ field
- Click on the ‘Set Field-Level Security’ button and check the ‘Visible’ box for any profiles that should see the field (including your own!)
- Click ‘Save’
- Repeat for ‘Email Opt Out’
- Go to Setup > Object Manager > {Object} > Page Layouts
- Click on the name of the page layout you wish to edit
- Go to the Fields section and locate the ‘Do Not Call’ and ‘Email Opt Out’ fields
- Drag and drop on to desired location on the page layout and click ‘Save’
👉 Upload four images that you will use to visually display that your Lead or Contact has opted out of emails and/or calls – check out the resources section at the bottom for the images I’ve used!
You can upload and save your image as a static resource, a document in Classic or a file in Lightning. Copy and put aside your image locations. Not sure how? Check out this guide on how to identify your image location (you’ll need this info later).
The solution
We’ll combine two image formula fields and a component on the Lightning record page to visually display whether or not our user can contact a Lead or Contact. For my tutorial I’m going to use the Contact object but I recommend doing this for Leads as well.
First we’ll create two new custom fields.
- Navigate to Setup > Object Manager > {Object} > Fields & Relationships
- Select ‘New’
- Date Type = Formula
- Field Label = Call? (or similar)
- Formula Return Type = Text
- Enter a description and help text
- Enter the formula below but replace the image location (in red) with your unique location (hint – check the prerequisites section for where to find it!)
- The first image location is your RED PHONE, the second image location is your GREEN PHONE
IF ( DoNotCall = TRUE, IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxg5", "Do Not Call"), IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxgF", "Call"))
- Your field should look something like this:
- Click ‘Save’
- Make visible for all profiles
- Do not add to the page layout
- Click ‘Save & New’
- Date Type = Formula
- Field Label = Email? (or similar)
- Formula Return Type = Text
- Enter a description and help text
- Enter the formula below but replace the image location (in red) with your unique location (hint – check the prerequisites section for where to find it!)
- The first image location is your RED ENVELOPE, the second image location is your GREEN ENVELOPE
IF ( HasOptedOutOfEmail = TRUE, IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxbP", "Do Not Email"), IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxgA","Email"))
- Your field should look something like this:
- Click ‘Save’
- Make visible for all profiles
- Do not add to the page layout
- Click ‘Save’
- Navigate to Setup > Object Manager > {Object} > Buttons, Links and Actions
- Click ‘New Action’
- Choose action type ‘Update a Record’, give it a name, a description and save
- Remove any fields you do not want to see
- Drag and drop your two formula fields (‘Call?’ and ‘Email?’) onto the layout
- Click ‘Save’
- An error message will appear – click ‘Yes’
- Navigate to Setup > Object Manager > {Object} > Lightning Record Pages
- Click on the name of the page you would like to edit
- Select ‘Edit’
- Drag and drop a Related Record component (left) onto the component canvas (somewhere highly visible)
- Select the component by clicking on it and set the component attributes:
- Header Label = Contact Preferences (or similar)
- Lookup Field = Use This Contact
- Update Action = Contact Preferences (or whatever you named the action you created in the previous steps)
- Click ‘Save’, and if required, activate the page
The result
An extremely eye catching way to make sure our users have no excuse not to be aware of contact preferences!
You can also use your new fields in reports and list views:
Gotchas & hints
*Can’t see the fields? You probably need to make them visible. Check out the prerequisites section!
*’Email Opt Out’ does not prevent individual emails being sent via Salesforce – it only prevents mass emails.
Useful links
Idea: E-Mail Opt Out doesn’t disable e-mailing
Salesforce Help: Consent Management for Sales Cloud
Cirrus Insight: How Do I Use the Email Opt-Out field in Salesforce?
Resources
Images:
Do Not Call Image Formula:
IF ( DoNotCall = TRUE, IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxg5", "Do Not Call"), IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxgF", "Call"))
Replace the parts highlighted in red with the location of your images.
Email Opt Out Image Formula:
IF ( HasOptedOutOfEmail = TRUE, IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxbP", "Do Not Email"), IMAGE("/servlet/servlet.FileDownload?file=0151o000005dxgA","Email"))
Replace the parts highlighted in red with the location of your images.
One thought on “Contact preferences your users can’t ignore!”