You can include date and time personalization in your emails. Date personalization with time references assumes that you entered time-related information in GMT.
Locations to personalize and valid formats
You can manually enter in date personalization fields and redefine the date format in the following areas:
- Email body
- Dynamic content blocks with personalization inside DC content
- Email body that contains external content
- Relational table personalization (RT and database fields)
- SMS message body
- Email header fields
- In email settings
- Mailing_sent_date_iso
- Mailing_sent_date
- Date
- Timestamp
- Numeric
- System Date
- Mailing_send_date
- Segment/send hour
Valid values for month are (case-sensitive):
- MMMM (for example, January)
- MMM (for example, Jan)
- M (for example, 1)
Valid values for day are (case-sensitive):
- dd (for example, 02)
- d (for example, 2)
Valid values for year are (case-sensitive):
- yyyy (for example, 1999)
- yy (for example, 99)
Examples:
- 2014-02-28 HH:mm:ss (hour in a day 0 - 23)
- 2014-02-28 hh:mm a (hour in am/pm)
- 02-28-2014 HH:mm
- 02-28-2014 HH:mm zzz (for example, GMT)
- 02-28-2014 HH:mm zzzz (for example, Greenwich Mean Time)
- 2014/07/24 12:00:00 AM
- Jan 24, 2014 14:00
- January 24, 2014 13:00:00
Valid numeric values - supported characters are as follows:
- 0 = A digit- always displayed
- # = A digit, leading zeros are omitted
- . = marks a decimal separator
- , = marks a grouping separator (for example, thousand separator)
- #,###.00 (for example, 1,000,000.63)
Show the dd/MMM/YYY date format in an email
In the following example, the following two fields are in the database:
-
- A date field that is called Birthday. In this example, the field contains the value "10/10/1980".
- A text field that is called DateFormatString. This field defines the format of ANY date field.
- Click Data > Contact lists.
- Open the contact's Edit Contact page.
- In the Date Format String field, type
"dd/MMM/YYYY"
. - Save the Edit Contact page.
- In the email body, type
%%format(Birthday, DateFormatString)%%
. - Save the email.
The two fields, Birthday and DateFormatString, are combined to show the birthday date as defined in the DateFormatString field: 10Oct1980
.
Important:
The following options do not work in tandem with language or locale. Instead, you can create dynamic content to use this feature with a language or country data field.
Show the yyyy-MMM-dd format in an email
Use the following option when you want to display a particular date format for an existing date database field in an email for all contacts who receive the email. To show the date format as yyyy-MMM-dd, do the following steps:
- Identify the date field, for example, "Birthday".
- In the email body, type this format:
%%format([enter date field name],"yyyy-MMM-dd")%%
- Save the email.
For example, the Birthday field from your database reads as 10/10/1980. You can change the format to:
%%format(Birthday, "yyyy-MMM-dd")%%
Now, all birthday dates shown in the email are in the yyyy-MMM-dd
format.
Use this option when you want to display a certain format for a specific contact. For example, you might want to show someone's birthday specific to the country they are living in, instead of how their birthday was entered into the Birthday field in the database.
Formatting examples
The following examples show how to add formatting to the email body by using the following format structure:
%%format([enter date field name],"[enter the combination of year, date, and month]")%%
%%format([enter date field name],"yyyy")%%
Example:
%%format(mailing_send_date,"yyyy")%%
%%format([enter date field name]_ISO)%%
Use one of the following formats:
copyright%%format([enter date field name],"yyyy")%%
©%%format([enter date field name],"yyyy")%%
%%format(mailing_send_date,"dd-MM-yyyy")%%
Dynamically add a send date
You can dynamically add a send date to the email body by using the %%MAILING_SEND_DATE%%
personalization tag. You can either manually type in the tag or select it from the Insert Personalization menu in the content builder.
Comments
4 comments
Hi,
There is a missing character in valid numeric values. Should be 1,000,000.63.
Is there a way that we can select the language for the date output? For example, if we use MMMM for a date field, instead of returning January, return "January" in Spanish.
Thanks!
Hi,
Is there a way to change the default date format field to a custom one?
For example, a date field that is formatted by default as 05-12-2020 instead of May, 05 2020
Thanks
Hello,
There is no option to select a language for the date output or to set a custom format for the date. If you'd like to request those features, please share your ideas at https://ideas.goacoustic.com/
I have a use case to add 14 days to the current date. How can I do that ?
Please sign in to leave a comment.