Contact preferences your users can’t ignore!

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!

Check out the idea here.

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):

  1. Go to Setup > Object Manager > {Object} > Fields & Relationships
  2. Click on the ‘Do Not Call’ field
  3. Click on the ‘Set Field-Level Security’ button and check the ‘Visible’ box for any profiles that should see the field (including your own!)
  4. Click ‘Save’
  5. Repeat for ‘Email Opt Out’
  6. Go to Setup > Object Manager > {Object} > Page Layouts
  7. Click on the name of the page layout you wish to edit
  8. Go to the Fields section and locate the ‘Do Not Call’ and ‘Email Opt Out’ fields
  9. 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.

  1. Navigate to Setup > Object Manager > {Object} > Fields & Relationships
  2. 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"))
  1. Your field should look something like this:

Call Formula

  1. Click ‘Save’
  2. Make visible for all profiles
  3. Do not add to the page layout
  4. 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"))
  1. Your field should look something like this:

Email Formula

  1. Click ‘Save’
  2. Make visible for all profiles
  3. Do not add to the page layout
  4. Click ‘Save’
  5. Navigate to Setup > Object Manager > {Object} > Buttons, Links and Actions
  6. Click ‘New Action’

Contact Preferences 1

  1. Choose action type ‘Update a Record’, give it a name, a description and save

Contact Preferences 2

  1. Remove any fields you do not want to see
  2. Drag and drop your two formula fields (‘Call?’ and ‘Email?’) onto the layout
  3. Click ‘Save’

Contact Preferences 3

  1. An error message will appear – click ‘Yes’

Contact Preferences 4

  1. Navigate to Setup > Object Manager > {Object} > Lightning Record Pages
  2. Click on the name of the page you would like to edit
  3. Select ‘Edit’

Contact Preferences 5

  1. Drag and drop a Related Record component (left) onto the component canvas (somewhere highly visible)
  2. 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)

Contact Preferences 6

  1. 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!

Contact Preferences 7

You can also use your new fields in reports and list views:

Contact Preferences 8.PNG


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:

Green Phone Red Phone

Green Email  Red Envelope

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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s