New
Are you ready for Agentforce? Take our assessment to find out today!
    • Expertise
          • Product

          • Sales Cloud
          • Service Cloud
          • Account Engagement
          • Marketing Cloud Next
          • Revenue Cloud
          • Agentforce
          • Data 360 (Data Cloud)
          • CRM Analytics
          • Tableau Next
          • Experience Cloud
          • Industry

          • Manufacturing
          • Healthcare
          • High Tech
          • Financial Services
          • Media & Entertainment
    • Solutions
      • Consulting
      • Implementation
      • Managed Services
      • Health Check
      • Training
    • About Nebula
      • We Are Nebula
      • Meet the Team
      • Join Our Team
    • Resources
    • Login
    • Get in Touch
Share:

Personalise emails with a formatted date in Account Engagement

by Hannah Shimali
15th October 2024 • 4 min read
Hannah Shimali
Share:

One of the benefits of using Account Engagement (Pardot) is the capability to personalise emails. We can use data from a date field to show when something has happened or is happening, for example; your renewal is coming up on DD/MM/YYYY, or your booking is on DD/MM/YYYY.

However, the formatting of this date field isn’t particularly user-friendly. How can we get the date field in our emails but also formatted in an easily readable way?

 

When creating new fields in Account Engagement or Sales Cloud, you have the option to define what field type it will be. Following the field creation, you can map them to use them in various ways that are important to your business i.e. dynamic lists, email communications, Salesforce reporting and much more. Below are the recommended field type mapping between both platforms:

Salesforce Field TypeAccount Engagement Field Type
CheckboxRadio Button/Dropdown
Multi-SelectCheckbox
PicklistRadio Button/Dropdown
FormulaX Not recommended
LookupX Does not map
PhoneText
DateDate
Text Area (Rich)Textarea (will display HTML code)

ICYMI, the default date field when used will always display as YYYY/MM/DD in Account Engagement or YYYY/MM/DD in Sales Cloud (but this presentation depends on your user’s locale setting i.e. In the UK we’ll see it as DD/MM/YYYY but in the US they’ll see the same date as MM/DD/YYYY).

Now this can be frustrating when wanting to use the date field in your communications in Account Engagement (using either HML or the legacy variable tag) and it does not align with your brand guidelines.

Fortunately, there are ways around this and you only will need to do two things:

  1. Create a text field on the Contact Object in Salesforce and map to a corresponding field in Account Engagement
  2. Modify specific records in Salesforce with an automated trigger using Apex (this can be done in flow as well but for the purpose of this blog, we will stick to Apex)

1. Create a new text field

When you create a custom text field, you can display the text in whatever format you wish to have. This includes using numbers and characters on that same field.

N.B. For the different ways to display a date, reference what is available on Microsoft Excel/Google Sheets.

Once you decide on the new format for your date field, create a copy of the original field but change the type to a text field and this can remain blank for now.

2. Modify specific records in Sales Cloud with an automated trigger

For this part, you will need a developer or someone who is experienced in Apex but we have provided an example code below.

Let’s use a Sales Cloud and Account Engagement example for a date where we want to populate Booking_Date_Formatted__c with the date from Booking_Date__c on the Contact object.

First, you need a trigger on before insert and update of Contact (best practice is to have a single trigger per object so you’d combine this with any existing trigger logic you have on Contact):

trigger ContactTrigger on Contact (before insert, before update) {
switch on Trigger.operationType {
when BEFORE_INSERT {
ContactTriggerHandler.formatBookingDate(new Map<Id, Contact>(), Trigger.new);
}
when BEFORE_UPDATE {
ContactTriggerHandler.formatBookingDate(Trigger.oldMap, Trigger.new);
}
}
}
Then you’d have your trigger handler code which would do the actual formatting of the date:
public without sharing class ContactTriggerHandler {
public static void formatBookingDate(Map<Id, Contact> oldMap, List<Contact> newList) {
Contact oldContact = oldMap.get(newContact?.Id);
if(oldContact?.Booking_Date__c != newContact.Booking_Date__c)
newContact.Booking_Date_Formatted__c = ((Datetime) newContact.Booking_Date__c)?.format('d MMMM YYYY');
}}}
}

And just like that, we have a re-formatted date field that can be used in your email communications in Account Engagement:

Considerations

  • This will only work for fields that are mapped to a corresponding field in Sales Cloud
  • We have used the Contact object in this example, but if the field is from a different object then the code will need amending
  • Always test this in a Sandbox first before pushing into Production, and always write unit tests for any new code in your org
  • Configure the field visibility settings for the new field and page layouts if you want this to be visible to users in Sales Cloud (including the connector/integration user in AE)

Find related resources by topic

Marketing

You may also be interested in

Fix the Foundations: Success in the Agentic Era Marketing Edition
Blog
Marketing

Fix the Foundations: Success in the Agentic Era Marketing Edition

We hear the announcements and on repeat about how the Agentic Era is here to transform the B2B and B2C landscapes. These changes will enable…

4 min read Read Blog
Laying the Right Foundations
Success Story
Account Engagement Sales Cloud

Laying the Right Foundations

Complex processes and cautious stakeholders hindered Redwheel's CRM adoption. Nebula's Account Engagement and Salesforce audits mapped the journey, restoring confidence and delivering a strategic roadmap for a powerful, sales-enabled CRM.

May 27, 2025 Read Customer Story
How to Avoid Completion Action Limits in Account Engagement (Pardot) Using Engagement Studio
Blog
Marketing

How to Avoid Completion Action Limits in Account Engagement (Pardot) Using Engagement Studio

Conditional completion actions and completion actions, while powerful, can quickly consume the available limits on your forms and form handlers. If you’ve been creating and managing…

3 min read Read Blog
Aligning Marketing and Sales for a Global Insurer
Success Story
Account Engagement Sales Cloud

Aligning Marketing and Sales for a Global Insurer

Poor email deliverability and disconnected data misaligned Lockton's sales and marketing. Nebula's Salesforce and Account Engagement integration established governance, delivering a 97% delivery rate, 25 empowered users, and transparent insights.

Apr 30, 2025 Read Customer Story
Upgrade Your Form UX with Toggle Switches
Blog
Marketing

Upgrade Your Form UX with Toggle Switches

If you would like to modernise your forms, provide a slicker user experience, and match contemporary web design, follow our mini guide that helps you…

2 min read Read Blog
Creating a seamless membership experience
Success Story
Account Engagement Sales Cloud Service Cloud

Creating a seamless membership experience

Data silos and disparate systems hindered the World Travel and Tourism Council's membership experience. Nebula's Cvent integration, record cleansing and automated invoicing delivered rapid efficiency, unified data, and a 10-year partnership.

Jan 30, 2025 Read Customer Story
Account Engagement Landing Page Conversion Mastery
Blog
Marketing

Account Engagement Landing Page Conversion Mastery

Building pages that truly perform in Account Engagement isn't just about clicking buttons; it's about strategy, technical finesse, and empathy for the user. Here’s my…

5 min read Read Blog
Targeted Sales Enablement for Users
Success Story
Account Engagement CRM Analytics Sales Cloud

Targeted Sales Enablement for Users

Stale opportunities and missing data delayed Clarion Events' pipeline. Nebula's Einstein Next Best Action delivered intuitive guidance, surging stage moves by 132%, doubling activities, capturing crucial VAT details, and boosting CRM adoption.

Jan 3, 2025 Read Customer Story
5 Hidden Snags in Account Engagement
Blog
Marketing

5 Hidden Snags in Account Engagement

Managing Salesforce Account Engagement (Pardot) requires more than just marketing knowledge. Even in a well-established org, you can sometimes hit some invisible walls. Below are…

4 min read Read Blog
5 new Marketing Cloud Next features we’re excited to try
Blog
Marketing

5 new Marketing Cloud Next features we’re excited to try

The Spring ’26 release is here, and it’s a significant milestone for Marketing Cloud Next (also known as Agentforce Marketing). This release focuses on making…

4 min read Read Blog
Nebula

Our journey started in 2012 with a clear vision and core values. Nebula is dedicated to empowering our customers through fostering relationships founded on collaboration, flexibility, and trust.

  • We Are Nebula
  • Resources
  • Join Our Team
  • Terms and Conditions
  • Privacy Policy
The Space Aldgate,
Irongate House,
22-30 Dukes Place,
London EC3A 7LP
+44 207 112 8026
Get in Touch
Copyright © 2026 Nebula Consulting. All Rights Reserved.