Create Mailability Flags in Salesforce for Highly Visible Communication Preferences

Share this article...

Mailability Flags clearly show who can, or can’t, be contacted by marketing emails. It’s important to give this visibility into communication preferences on Salesforce, so you can link up what’s going on in your Marketing Automation Platform (Pardot, Marketing Cloud, or others), and share the info with the wider team across different functions, such as sales, service or finance.

The hack I will show you will display a coloured flag on the Lead or Contact record in Salesforce – it’s simple but effective. I will give you 3 examples to use according to how many channels you want to cover, and how complex you want to go.

“Formassembly"

Create a Flag Formula Field

A flag field is a Salesforce formula field that displays an image when conditions are met – in this case, either a red, orange or green flag will display when the relevant conditions exist.

Just like creating any custom field in Salesforce setup, go to the ‘Object Manager’, and search for Leads. Then, go to ‘Fields and Relationships’, and click the ‘New’ button.

Step 1: Formula Field

Select ‘formula’ from the list of field types.

Step 2: Choose Output Type

Choose the output type as Text:

Step 3: Formula Editor

You may want to come back to this step after you’ve read the examples that follow this section. In order to build your formula, you will need a clear idea of which checkbox fields you will be using, and what combination of fields checked/uncheck will show the red, orange, green flags.

The below is a simple example to get you started with (I will dig into the significance behind this later on). This formula will show:

  • Green flag = when the lead is not opted-out, and not marked as ‘do not email’ (see this post for an explainer on the differences).
  • Orange flag = when the lead is opted-out, but is not marked as ‘do not email’
  • Red flag = when the lead is marked as ‘do not email’.

Here’s a breakdown of the formula.

Line 1:

IF

(HasOptedOutOfEmail = TRUE && Do_Not_Mail__c = TRUE,

IMAGE(“/img/samples/flag_red.gif”, “Red Flag”),

If ‘opted out’ is true (checked), and ‘do not email’ is true (checked), then show the RED flag.

Line 2:

IF

(HasOptedOutOfEmail = TRUE && DoNotCall = FALSE,

IMAGE(“/img/samples/flag_yellow.gif”,”Yellow Flag”),

If ‘opted out’ is true (checked), but ‘do not email’ is false (unchecked), then show the RED flag.

Line 3:

IMAGE(“/img/samples/flag_green.gif”,”Green Flag”)))

Otherwise, show the green flag.

 

Go ahead and paste the complete formula into the formula editor:

IF

(HasOptedOutOfEmail = TRUE && Do_Not_Mail__c = TRUE,

IMAGE("/img/samples/flag_red.gif", "Red Flag"),

IF

(HasOptedOutOfEmail = TRUE && DoNotCall = FALSE,

IMAGE("/img/samples/flag_yellow.gif","Yellow Flag"),

IMAGE("/img/samples/flag_green.gif","Green Flag")))

Step 4: Check Syntax

Click ‘Check Syntax’ in case your Salesforce org uses different field names, instead of the standard ones.

Once you save, your overview screen will look something like this:

Don’t forget to repeat for the contact object.

Example Mailability Flag Formulas

Here are some examples of mailability flags I have set up for my clients. These formulas use the standard Salesforce fields (where applicable), plus some custom ones that creep their way in; be aware that you need to replace the field names with your own, and a syntax check (step 4) will quickly tell you whether the fields are available in your org.

Example 1: No Marketing Emails Allowed

When you want to flag to Salesforce users that the recipient can’t receive marketing emails, but the user won’t be blocked from sending operational emails. This is useful for business functions such as Service Teams or Finance that are under obligation to contact customers in certain instances, think invoicing, critical updates, service outage etc.

The colour flags apply as follows:

  • Green = If not ‘do not email’ and not opted out
  • Orange = If opted out, but not ‘do not email’ (so operational emails will be sent, operational emails won’t be blocked)
  • Red = If ‘do not email’ and opted out

 

Paste the formula into the formula editor:

IF

(HasOptedOutOfEmail = TRUE && Do_Not_Mail__c = TRUE,

IMAGE("/img/samples/flag_red.gif", "Red Flag"),

IF

(HasOptedOutOfEmail = TRUE && DoNotCall = FALSE,

IMAGE("/img/samples/flag_yellow.gif","Yellow Flag"),

IMAGE("/img/samples/flag_green.gif","Green Flag")))

Example 2: Managing Multiple Channels

Often organisations deploy a number of different communication channels to communicate with customers, such as email, phone call, SMS, post, amongst others.

By showing an orange flag, it prompts users to check which contact methods are allowed in this instance, and more crucially, which are not.

The colour flags apply as follows:

  • Green = If not opted out of any
  • Orange = IF Opted out of Email OR Phone OR SMS
  • Red = If not opted out of all (Email AND Phone AND SMS)

Paste the formula into the formula editor:

IF

(HasOptedOutOfEmail = TRUE && DoNotCall = TRUE && SMS_Opt_Out__c = TRUE,

IMAGE("/img/samples/flag_red.gif", "Red Flag"),

IF

(HasOptedOutOfEmail = TRUE || DoNotCall = TRUE || SMS_Opt_Out__c = TRUE,

IMAGE("/img/samples/flag_yellow.gif","Yellow Flag"),

IMAGE("/img/samples/flag_green.gif","Green Flag")))

Example 3: Tracking Confirmed Opt-in

Confirmed opt-in, also known as double opt-in, became increasingly important the post-GDPR world where consent capture and management standards have become more stringent. Double opt-in asks that prospects consent twice – once when they initially subscribe, then again to confirm their consent. The double opt-in setup requires two checkboxes, and so, there’s a chance that prospects stay in a pending confirmation status; an orange flag is perfect to highlight these pending subscribers.

The colour flags apply as follows:

  • Green = Has double opted-in
  • Orange = IF NOT double opted-in, but has not opted-out/hard bounced
  • Red = Has not opted-in at all

Paste the formula into the formula editor:

IF( AND(Double_Opted_in__c = TRUE),

IMAGE("/img/samples/flag_green.gif","Green Flag"),

IF(Double_Opted_in__c <> FALSE, pi__pardot_hard_bounced__c <> FALSE, HasOptedOutOfEmail <> FALSE),

IMAGE("/img/samples/flag_yellow.gif","Yellow Flag"),

IMAGE("/img/samples/flag_red.gif", "Red Flag")))

Example 4: Verified Email Address

You may decide to use a 3rd party email verification provider to identify invalid email addresses (old, dummy) and ultimately, keep a clean database. While mainstream providers can give you a status for each email address (valid, invalid, catchall), let’s pretend that you have checked a checkbox for any individual with a valid email address.

Paste the formula into the formula editor:

IF

(Verified_email_address__c = TRUE,

IMAGE("/img/samples/flag_green.gif", "Green Flag"),

IF

(pi__pardot_hard_bounced__c = TRUE,

IMAGE("/img/samples/flag_red.gif","Red Flag"),

IMAGE("/img/samples/flag_orange.gif","Orange Flag")))

Implementation Tips

Visible and Position on Page

When you manage fields in Salesforce, you have the option to control whether a field can be seen (visibility) by user profile – in fact, when you went through the setup steps, you would have come across field-level security, so check they relevant teams (not just marketing!) can see the field.

Adding it to the page layout is essential, but consider moving it to a more prominent position on the page so that users can’t miss it. Take advantage of the Highlights Panel, which holds the fields you deem most important.

Editable

Formula fields are not editable, which makes sense because their values are determined by the formula, not by a user. Other fields, notably checkbox fields, are editable for users.

Bringing the topic of communication preferences to the forefront and bolstering internal processes can breed ‘dirty’ tactics and corner-cutting; a user may be frustrated that they cannot contact a customer or prospect, and so change the preferences checkboxes in an attempt to turn the mailability flag green.

Revise who has editing rights on preference fields such as ‘do not email’, ‘Email opt-out’, etc.

Testing

Test each combination of fields and which colour flag should appear. It’s easy to get tripped up, so I find mapping each field and True/False combinations in a spreadsheet to ensure I systematically cover all scenarios.

Add Help Text

Add help text and a description when you create the formula fields. A description is for Admins’ information in the system back-end, whereas help text is for users and will appear by hovering over the icon next to the field; keep this in mind when you are writing help text, to keep it relevant and clear for each audience.

Some example help text for users:

When the flag is red, this contact cannot be emailed by marketing by law. The contact has either opted out (unsubscribed), or caused a hard bounce (email does not exist/deactivated).

Educate

In addition to adding help text, set up user training sessions that include other teams in the organisation; don’t fall into the mindset that mailability should only be for marketing! One side benefit of Mailability flags I have come across, is that their presence helps to teach the differences between ‘do not email’ and ‘opted-out’.

Summary

A flag formula fields display a red, orange or green flag when the relevant conditions are met. It’s great how much flexibility Admins and Marketers can have over what factors should result in which colour flag, as you can see, so long as you have a checkbox field for that preference, you can factor it into a neat formula field.

Mailability flags are a simple setup that have numerous side benefits, mainly of simplifying multichannel consents, aiding cross-team understanding, and of course, compliance that respects customer or prospect preferences.

4 thoughts on “Create Mailability Flags in Salesforce for Highly Visible Communication Preferences

  1. Avatar

    Just sat down to do this and am getting a syntax error on the image file. The images exist and I even tried to paste in the full url but still get an error. 🙁

    1. Lucy Mazalon

      Hi Andi – thanks for pointing that out. Ah ha! I found the issue. The post was using curly quote marks and not straight quote marks (in the editor it appeared correct but was then re-formatted when the post was published). I have updated the post to use preformatted text, and I’m not getting any syntax errors :). Thanks once again, hope you enjoy using the flags!

Leave a Reply