When using merge fields to personalize your emails and landing pages, you can format them so that the content appears just the way you’d like.
You can also use special merge fields to tailor your messaging even further.
 

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.

(Advanced) Manual formatting for “Date” and “Date and Time” merge fields

keyboard_arrow_downkeyboard_arrow_up


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:
 

  • Insert the “Date” or “Date and time” merge field you’d like to format.
  • Replace the characters contained between two “%”, [Birthday %M j, Y%+0], with a custom string you create using the characters below.

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 Character
Description
Example of what you’ll see
Day characters
d The day of the month shown in two digits with leading zeros 01 to 31
D A three-letter abbreviation for the day of the week Mon through Sun
j 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
N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
S The two character English ordinal suffix for the day of the month St, nd, rd or th — This works well with “j”
w A number that represents the day of the week 0 (for Sunday) for 6 (for Saturday)
z The day of the year (starting from 0) 0 through 365
Week characters
W ISO-8601 week number of year, weeks starting on Monday Example: 42 (for the 42nd week in the year)
Month characters
F The full name of the month January through December
m The numeric representation of a month, with leading zeros 01 through 12
M A three letter abbreviation of the month Jan through Dec
n The numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31
Year characters
L Whether or not it’s a leap year 1 if it is a leap year, 0 otherwise.
o 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
Y A full four digit representation of a year 1999 or 2003
y A two digit representation of a year 99 or 03
Time characters
a Lowercase ante meridiem and post meridiem am or pm
A Uppercase ante meridiem and post meridiem AM or PM
B Swatch Internet time 000 through 999
g 12-hour format of an hour without leading zeros 1 to 12
G 24-hour format of an hour without leading zeros 0 through 23
h 12-hour format of an hour with leading zeros 01 through 12
H 24-hour format of an hour with leading zeros 00 through 23
i Minutes with leading zeros 00 to 59
s Seconds with leading zeros 00 through 59
u Microseconds 654321
v Milliseconds 654
Timezone characters
e 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.
O Difference to Greenwich time (GMT) without colon between hours and minutes +0200
P Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3) +02:00
T Time zone abbreviation EST, MDT, PST
z 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
Full Date/Time characters
c ISO 8601 date 2004-02-12T15:19:21+00:00
r RFC 2822 formatted date Thu, 21 Dec 2000 16:01:07 +0200
U Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) 1599584853

keyboard_arrow_downkeyboard_arrow_up


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.

Mary Ann

[First Name ##cap] – Capitalize the first letter of each word. Ignore all other letters.

Mary ANN

[First Name ##cap_first] – Capitalize the first letter in the first word only, and ignore all the other letters.

Mary aNN

[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.

Mary aNN

[First Name  ##lowercase] – Convert all letters to lowercase.

“mary ann”

 

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.


create a link example

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.


create a link example

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.