Formatting Date Merge Fields
Date fields can be formatted in 11 different styles and, when you add date merge fields, you can use the pop up date formatter to choose how you would like the date to display.
Date merge fields have “date math” that can be applied in the merge field dialog box through the “Offset the date by” area. This allows you to add or subtract days from the date.
For example, you can write things like, “Happy birthday! Your offer will expire in one week on [Birthday %F j%+7]” in your messages and have it rendered as “Happy birthday! Your offer will expire in one week on January 28” if your contact’s birthday is on January 21.
Formatting Date and Time Merge Fields
Date and Time fields have 14 different styles that you can choose from when you insert merge fields.
Just as with date fields — you can offset your date and time by adding the days, hours and/or minutes you’d like.
For example, you could write, “Offer expires two days from now, on [nDate %l \a\t g:i a% contacts_time zone+2d0h0m]!” in your messages, and have your contact receive “Offer expires two days from now, on Monday at 3:50 pm!” for messages sent on Saturday at 3:50 pm.
keyboard_arrow_downkeyboard_arrow_up For example, if you wanted to print your contact’s birthday in the format, “Monday, Sep 7,” your merge field would look like [Birthday %l, M j%+0]. Or, if you want your contact’s birthday in the format, “7 September 2021,” your merge field would look like [Birthday %j F Y%+0]. keyboard_arrow_downkeyboard_arrow_up
(Advanced) Manual formatting for “Date” and “Date and Time” merge fields
You can also create custom “Date” and “Date and Time” fields by manually formatting your merge fields using the formatting characters below. Here’s how:
The day of the month shown in two digits with leading zeros
01 to 31
A three-letter abbreviation for the day of the week
Mon through Sun
The day of the month without leading zeros
1 to 31
l (lowercase ‘L’)
The full name of the day of the week
Sunday through Saturday
ISO-8601 numeric representation of the day of the week
1 (for Monday) through 7 (for Sunday)
The two character English ordinal suffix for the day of the month
St, nd, rd or th — This works well with “j”
A number that represents the day of the week
0 (for Sunday) for 6 (for Saturday)
The day of the year (starting from 0)
0 through 365
ISO-8601 week number of year, weeks starting on Monday
Example: 42 (for the 42nd week in the year)
The full name of the month
January through December
The numeric representation of a month, with leading zeros
01 through 12
A three letter abbreviation of the month
Jan through Dec
The numeric representation of a month, without leading zeros
1 through 12
Number of days in the given month
28 through 31
Whether or not it’s a leap year
1 if it is a leap year, 0 otherwise.
ISO-8601 week-numbering year.
This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.
1999 or 2003
A full four digit representation of a year
1999 or 2003
A two digit representation of a year
99 or 03
Lowercase ante meridiem and post meridiem
am or pm
Uppercase ante meridiem and post meridiem
AM or PM
Swatch Internet time
000 through 999
12-hour format of an hour without leading zeros
1 to 12
24-hour format of an hour without leading zeros
0 through 23
12-hour format of an hour with leading zeros
01 through 12
24-hour format of an hour with leading zeros
00 through 23
Minutes with leading zeros
00 to 59
Seconds with leading zeros
00 through 59
Time zone identifier
UTC, GMT, Atlantic/Azores
I (Capital i)
Whether or not the date is in daylight saving time
1 if Daylight Saving Time, 0 otherwise.
Difference to Greenwich time (GMT) without colon between hours and minutes
Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)
Time zone abbreviation
EST, MDT, PST
Time zone offset in seconds.
The offset for time zones west of UTC is always negative, and for those east of UTC is always positive.
-43200 through 50400
ISO 8601 date
RFC 2822 formatted date
Thu, 21 Dec 2000 16:01:07 +0200
Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
For example, if you wanted to print your contact’s birthday in the format, “Monday, Sep 7,” your merge field would look like [Birthday %l, M j%+0].
Or, if you want your contact’s birthday in the format, “7 September 2021,” your merge field would look like [Birthday %j F Y%+0].
Formatting Text Merge Fields
Text fields, such as First Name, are stored in your records exactly how they were entered into your forms or imported into your account. Many contacts fill out opt-in forms using all caps, all lowercase, or other alternative capitalization that is not consistent with the formatting you may want to present in your emails. You can standardize the way that your text fields display by modifying your text merge fields.
For example, a contact may fill out your form with the first name “mary aNN”, and you can format the first name merge field in the following ways:
[First Name ##cap_lower] – Capitalize the first letter in each word and force all others to lower case.
[First Name ##cap] – Capitalize the first letter of each word. Ignore all other letters.
[First Name ##cap_first] – Capitalize the first letter in the first word only, and ignore all the other letters.
[First Name ##cap_lower_first] – Capitalize the first letter of the first word and force the rest of the letters in the first word to lowercase, and ignore all other letters.
[First Name ##lowercase] – Convert all letters to lowercase.
Special Merge Fields
In addition to the standard merge fields, Ontraport has a few special merge fields that do more than print the value that is stored in a contact’s record.
Send Date: The merge field for send date will show the date that the message was sent. If you have an offer that is valid for two days, you can add in the merge field [nDate %F j%+2d0h0m] to show the date that the offer will expire.
Hosted Email Link: This merge field lets you create a “View in browser” link. This gives your contacts an alternate way to view your email if they can’t view HTML emails or if image loading is turned off in their inbox. Paste the [Hosted_Email_Link] merge field into the URL field when creating a hyperlink.
Coupon Codes: You can send both personal and group coupon codes to your contacts by using merge fields. You will find the coupons in the merge field dropdown in the section for “COUPON: Your Coupon’s Name”. You can add the coupon code, the date it was created, and the date the coupon expires. When a personal coupon code is sent to a contact, you can see it in the “coupons” tab of the contact’s record.
PURLs: You can insert personalized URLs (PURLs) to Ontraport hosted landing pages.
Staff Fields: By adding Owner merge fields to your messages, you can send contacts messages that have information from the user profile of the team member who owns that contact. Contact Owner merge fields are useful if you have a sales team and would like to include the name and contact information of the sales rep assigned to your contact.
Opt In Links: Adds a hyperlink that says “Confirm your Subscription.” If a contact who is single opted-in click this link, then their bulk email status will be updated to double opt-in.
Unsubscribe Link: All messages that are sent through your campaigns, or manual broadcasts to two or more contacts, will have an unsubscribe link automatically added to the bottom of the message. If you need to include an unsubscribe link in a message to a single contact, you can add the unsubscribe link. This adds a hyperlink that says “Click Here to Unsubscribe”, and when the link is clicked it will opt the contact out.
Unsubscribe Link Raw: This provides a long, raw unsubscribe link. This option lets you select the text you would like on your unsubscribe link. Paste the [unsub_link_raw] merge field into the URL field when creating a hyperlink.
Website membership details: Send out WordPress membership details like password, user name, status, etc. These are commonly used to send out WordPress credentials to your contacts.