✕
Skip to content
Salesforce Ben
  • Events
  • Career
  • AppAssessor
  • Salesforce News
  • Articles by Role
    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
  • Where to Start
  • Salesforce Certification List
  • How to Get Certified
  • Free Salesforce Practice Exams
    • Admin Practice Exam
    • Platform App Builder Practice Exam
    • Platform Developer 1 Practice Exam
  • How to Get a Job in Salesforce

Find us on:

Salesforce Ben
  • Events
  • Career
  • AppAssessor
  • Salesforce News
  • Articles by Role

      Articles by role:

    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
    • Featured

      The Great Salesforce Job Market Reset

      By Sasha Semjonova

      December 09, 2024
      How to Avoid Bad Salesforce Partners: The Three-Question Test

      By Jon Cline

      January 08, 2025
  • Newsletter
  • user
    • Courses Login
  • Events
  • Career
  • AppAssessor
  • Salesforce News
  • Articles by Role

      Articles by role:

    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
    • Featured

      The Great Salesforce Job Market Reset

      By Sasha Semjonova

      December 09, 2024
      How to Avoid Bad Salesforce Partners: The Three-Question Test

      By Jon Cline

      January 08, 2025

What’s trending

Salesforce Summer ‘25 Release: Everything You Need to Know Before Go-Live
Is CRM Dying or Evolving? How AI is Transforming the Industry
Agentforce Pricing Update: Salesforce Announces Major Changes
13 Hottest Salesforce Summer ‘25 Features for Admins
Salesforce Summer ’25 Release Date + Preview Information

UPCOMING EVENTS

Agentforce World Tour Warsaw

20
May

Warsaw, Poland

Salesforce Official

Get Started with Agentforce for Free: Kickstart Workshop

20
May

Virtual

SF Ben Webinar

Agentforce World Tour NYC

21
May

New York, NY

Salesforce Official

SF Ben Breakfast Blend: NYC Edition

21
May

Kahlo, NYC

After Party

Salesforce Ben Yacht Party

21
May

Eternity Yacht, NY

After Party
See more
Share
Marketers / Account Engagement (Pardot) / Sales Cloud

Create Mailability Flags in Salesforce for Communication Preferences

By Lucy Mazalon

March 02, 2023

Mailability Flags clearly show who can, or can’t, be contacted by marketing emails. Visibility into communication preferences on Salesforce records helps to link up what’s going on in your marketing automation platform (Pardot, Marketing Cloud, etc.) giving a clear indication to more teams across the organization (e.g. sales, service, or finance).

Display a colored flag icon on the Lead or Contact record in Salesforce – it’s simple, but effective. This guide will show you how to create it, examples to try out, and some tips to make the most of this hack.

Step 1: Create a Salesforce Formula Field to Show a Flag

This type of Salesforce formula field displays an image when conditions are met – in this case, either a red, orange or green flag will display according to the subscriber’s preferences.

If you feel lost with the process to create a formula field, you may find the guide below useful for additional context:

READ MORE: How to Create a Salesforce Formula Field
  • In Salesforce setup, go to the Object Manager, and search for Leads. Go to Fields and Relationships, and click the New button.
  • Select Formula from the list of field types. Choose the output type: Text.

Step 2: Plan Out Your Flags

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 an example to get you started with to show:

  • Green flag: When the subscriber is not opted out, and not marked as Do Not Email (Pardot mailability status = Mailable).
  • Orange flag: When the Lead is opted-out, but is not marked as Do Not Email (Pardot mailability status = Transactional Emails Only).
  • Red flag: When the Lead is marked as Do Not Email or an email has bounced when sent to the subscriber (Pardot mailability status = Transactional Emails Only or Undeliverable).
READ MORE: What is a Mailable Prospect in Pardot? Do Not Email vs. Email Opt-Out

Note: Do Not Email (Pardot field) is not mapped to Salesforce by default. In the examples, you will see I’ve referenced a custom field (appended with __c).

Here’s a breakdown of the formula:

  • Line 1:

IF

(HasOptedOutOfEmail = TRUE && Pardot_Hard_Bounced = TRUE,

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

If Email Opt Out is true (checked), and Pardot Hard Bounced is true (checked) → then show the RED flag.

  • Line 2:

IF

(HasOptedOutOfEmail = TRUE && Do_Not_Mail__c = FALSE,

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

If Email Opt Out is true (checked), but Do Not Email is false (unchecked) → then show the YELLOW flag.

  • Line 3:

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

Otherwise, show the green flag.

Step 3: Formula Editor

On the next screen in the formula field set up, go ahead and paste the complete formula into the box:

IF

(HasOptedOutOfEmail = TRUE && Do_Not_Mail__c = TRUE,

IIF
(HasOptedOutOfEmail = TRUE && Pardot_Hard_Bounced = TRUE,
IMAGE(“/img/samples/flag_red.gif”, “Red Flag”),

IF
(HasOptedOutOfEmail = TRUE && Do_Not_Mail__c = FALSE,
IMAGE(“/img/samples/flag_yellow.gif”,”Yellow Flag”),

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

Step 4: Check Syntax

Click Check Syntax to check your formula is using the correct field names and is formatted correctly. Once you save, your overview screen will look something like this:

Don’t forget to repeat the steps above for the Contact, and/or Person Account object.

Further Example Mailability Flag Formulas

  • Transactional emails only: Account Engagement will not allow marketing emails to be sent when either the Do Not Email or Opted Out checkboxes are checked – they can only receive 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.
  • Managing multiple channels: With more channels than email to consider, you can extend mailability fields to phone call, SMS, physical mail, etc.
  • Tracking confirmed opt-in: Also known as double opt-in, this request asks that subscribers confirm their consent twice. The double opt-in setup requires two checkboxes which means that there’s a chance that subscribers stay in a ‘pending’ status – an orange flag is ideal to highlight this.
  • Verified email address: You may decide to use a third party email verification service to identify invalid email addresses and, ultimately, keep a clean marketing database.
READ MORE: Email Verification Tools for Pardot (Account Engagement)

Implementation Tips

1. Visibility On the Record Page

When you went through the formula field setup steps, you would have come across field-level security (which determines who can see the field) – so check that the relevant audiences can see the field.

Adding the field to the page layout is a given – but have you considered moving it to a more prominent position? Take advantage of the Highlights Panel which holds the fields your organization considers the most important:

2. Make Fields Uneditable

Formula fields are not editable, which makes sense because their values are determined by the formula. Other fields can be editable for users. Audit who has editing rights on preference fields such as Do Not Email, Email Opt-Out, etc.

3. Test Each Scenario

Test each combination of field values and cross-reference the color flag which appears alongside what you would expect. It’s easy to get tripped up, so I find mapping each field and True/False combinations in a spreadsheet ensures that I systematically cover all scenarios.

4. Add Help Text

Add help text and a description when you create the formula fields. A description is for admins’ information in the back-end. Help text is for users and will appear by hovering over the icon next to the field. Keep 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. The contact has either opted out (unsubscribed), or caused a hard bounce (email does not exist/deactivated).

5. Spread the Word

In addition to adding help text, set up user training sessions that include other teams in the organization; don’t fall into the mindset that mailability should only be for marketing!

Summary

Mailability Flags clearly show who can, or can’t, be contacted by marketing emails. Visibility into communication preferences on Salesforce records helps to link up what’s going on in your marketing automation platform (Pardot, Marketing Cloud, etc.) giving a clear indication to more teams across the organization (e.g. sales, service, or finance).

Display a colored flag icon on the Lead or Contact record in Salesforce – it’s simple, but effective. This guide has shown you how to create it, examples to try out, and some tips to make the most of this hack.

The Author

Lucy Mazalon

Lucy is the Operations Director at Salesforce Ben. She is a 10x certified Marketing Champion and founder of The DRIP.

More like this:

Marketers

Salesforce vs. Braze vs. Klaviyo: Comparing Marketing Automation Tools

By Alina Makarova

May 16, 2025
Marketers

What Google’s Cookie Reversal Means for CDP and Data Clean Rooms

By Alina Makarova

May 14, 2025
Marketers

Salesforce UTM Tracking: How to Capture Every Touchpoint

By Adam Erstelle

May 12, 2025

Comments:

    Andi
    December 14, 2019 10:18 am
    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. :-(
    Reply
    Lucy Mazalon
    December 20, 2019 9:08 am
    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!
    Reply
    Andi Morton
    December 31, 2019 4:10 am
    Thanks Lucy, I have this working now. Trying to add a few different cases now, like... if email address is empty mailability flag equals red! :-)
    Reply
    Lucy Mazalon
    December 31, 2019 12:25 pm
    Nice, I like that idea!
    Reply
    dino game
    March 31, 2023 8:23 am
    Great knowledge. Thank you for everything.
    Reply

Leave a Reply Cancel reply

Newsletter:

    By signing up you agree to our Terms of Use and Privacy Policy.

    Find us on:

    Salesforce Ben

    Salesforce Ben
    Third Floor Library Building
    Sun Street
    Tewkesbury
    Gloucestershire
    United Kingdom
    GL20 5NX

    • Where to Start
    • Salesforce Certification List
    • How to Get Certified
    • Free Salesforce Practice Exams
      • Admin Practice Exam
      • Platform App Builder Practice Exam
      • Platform Developer 1 Practice Exam
    • How to Get a Job in Salesforce
    • Events
    • Career
    • AppAssessor
    • Salesforce News
    • Articles by Role
    • Admins
    • DevOps
    • Developers
    • Marketers
    • Consultants
    • Architects
    • Business Analysts
    • About Us
    • Contact Us
    • Write For Us
    • Influencer Program
    • Advertise With Us
    • Pledge 1%
    • Privacy Policy
    • Change Cookie Preferences
    • Log in to Courses

    © 2014-2025 SalesforceBen.com