Using merge codes to personalize messages

Themes of this article

 

Our merge codes allow you to personalize your emails by merging any field from your contact list (such as the contact's name). It's easy to use and can be done in just a few steps!

 

 

What are personalization codes?

They are a set of special codes from E-goi that, based on the data you have in your contact list, help to automatically personalize the messages you send to each contact.

From basic information, like name, to any other field in your contact list (like mailing address, nearest store, date of birth, favorite products, etc.), our merge codes provide immense flexibility and personalization.

Using them is simple, just insert the code in the message where you want the personalized contact information to appear.

Example: Imagine that your contact list in E-goi has the name of each contact and you want to personalize your greeting ("Hi, Sandy", "Hi, John", "Hi, Jennifer", etc.). Simply place our code next to "Hi" in the text of your message (i.e., "Hi, !fname")

 

 

Requirements to use merge codes

  • Any E-goi account.
  • A contact list that, in addition to the email address or mobile number, also includes data that the merge codes can use (e.g., name, date of birth, etc.)

 

 

Costs

Merge codes are available in any E-goi account.

Using them doesn't have any costs, nor does it incur any additional costs in messages with merge codes. However, sending messages (e.g., email, SMS) will have their own costs, which depend on your E-goi plan.

 

 

Before you begin

 

Use cases

Merge codes are perefect for:

  • Personalized greetings: "Hello, Sandy! We have news for this week!".
  • Messages with specific offers for each contact: "Sandy, as our VIP customer, we have an exclusive offer. Use voucher SANDYVIP. Only today!".
  • Exclusive information, like the nearest store: "Our store network is at your disposal. Visit us at Egoi Ave, 555".
  • Personalization based on previous behaviors: "These are today's news based on your preference about Soccer".

 

 

Where to use merge codes

The codes can be used in the following campaigns:

 

 

Main codes

They are:

!fname
First name of the contact

!lname
Last name

!fullname
Full name

!email
Email address

!cellphone
Mobile number

!telephone
Phone number

!birth_date
Date of birth

!dateadd
Date of registration in the contact list

!lang
Language

!uid
Contact ID in E-goi

!extra_field_X
Any extra field you have added to the list (e.g. postal address, customer code, favorite products, etc.). The "X" must be replaced by the number of the extra field.

If you don't know that number, just go to the "Lists" menu and click on "Options" for the corresponding list.

 

 

Step-by-step

 

 

Insert a merge code

1) Edit the message in E-goi, positioning the cursor where you want to personalize it.

2) In the text editing panel (assuming you're using the Email Builder editor), click the merge codes button.

3) Choose the code in the code window and copy it.

4) Paste the code in the message.

 

 

Test the merge code

While previewing a campaign

1) Preview the campaign. The message will automatically appear personalized for a random contact from the contact list to which you will send the campaign.

2) If you want to see the personalization for a specific contact, choose the One contact only option in the preview, type in the contact's email, and click Apply.

 

While testing a campaign delivery

1) Do a delivery test to an email address or cell phone number that is in the contact list to which you will send the campaign.

Important! If the contact doesn't have the information you want to personalize (e.g. their name), the code simply won't appear in the preview or test (i.e. the message will display "Hi" instead of, for example, "Hi Sandy").

 

 

Inserting dates

In addition to contact data, merge codes can also insert dates and years into your message.

Example: If you have the birth dates of your contacts in E-goi, you can create a message that says "Happy Xth birthday!" where "Xth birthday" is automatically calculated based on the birth date.
The available codes are (in these examples, we use January 16, 2034 as today's date):

 

Code Result Description
!today 2034-01-16 Displays today's date in format YYYY-MM-DD.
{!today:DATEFORMAT:Y/m/d} 2034/01/16 Changes the date format.

Some supported formats:
Y/m/d
d/m/Y
d-m-Y
d.m.Y

You can use any date order. We also support other formats as per PHP guidelines.
 
{!birth_date:AGE:YEARS} 30
(depends on the contact's birthdate, which is automatically provided by the !birth_date code)
Displays the contact's age in years.
{!dateadd:AGE:DAYS} 72
(depends on the contact's subscription date, which is automatically provided by the !dateadd code )
Displays the number of days since the contact subscribed to the list.
{!today:DATEADD:+5:DAYS} 2034-01-21 Adds 5 days to today and displays the new date.


You can also combine multiple merge codes separating them with a colon.

Example: To add 5 to today and display the result in DD/MM/YYYY, use this code:
{!today:DATEADD:+5:DAYS:DATEFORMAT:d/m/Y}

 

 

Advanced merge codes

E-goi's advanced merge codes help improve the way your contact's info is shown in your messages.

Example: If your contact's first names in E-goi aren't consistely uppercased (eg. Sandy, jOhn, JENNIFER), you can auto-capitalise them (eg. Sandy, John, Jennifer).
Our advanced merge codes follow this template:

{merge_code:option}

Where "merge_code" is any of our codes and "option" is one of the following:

 

Option Description Example Result
UPPER or TOUPPER Switch to uppercase. Dear {!fullname:UPPER}! Dear JOHN ROBINSON,
LOWER or TOLOWER Switch to lowercase. Dear {!fullname:LOWER}, Dear john robinson,
UCWORDS Capitalises every word. Dear {!fullname:UCWORDS}, Dear John Robinson,
UCFIRST Capitalises the first word only. Dear {!fullname:UCFIRST}, Dear John robinson,
FIRSTWORD Shows the first word only. Hi, {!fullname:FIRSTWORD}! Hi, John!
LASTWORD Shows the last word only. Dear Mr {!fullname:LASTWORD}, Dear Mr Robinson,
TRUNCATE Cuts off any text beyond X characters (use the ":1" parameter to keep the last char).

If you don't keep the last char and the text has multiple words, only the first word will be shown.
Dear {!fname:TRUNCATE:4:1},
Dear {!fname:TRUNCATE:4},

Dear {!fullname:TRUNCATE:11:1},
Dear {!fullname:TRUNCATE:11},
Dear John,
Dear Joh,

Dear John Robins,
Dear John,
IF:!segment_x=1
contents1 ELSE:
contents2
ENDIF
Shows different contents for specified segments in your email, SMS and SmartSMS sends.

Replace "x" with your segment ID.

"=1" means "if segment is x". In case you'd like this to be "if segment ISN'T x", change it to "=0".
{{IF:!segment_x=1}}
Hello Mrs {{fullname}},
{{ELSE:}}
Hello Mr {{fullname}},
{{ENDIF}}
Hello, Mrs Jane Robinson,

Hello, Mr John Robinson,
URLENCODE Converts to URL (eg. when parsing to an external CRM the name of anyone clicking through a link in your email). //www.example.com/?data={!fullname:URLENCODE} //www.example.com/?data=John+O%27Sullivan

 

 

Displaying the contact's first name and capitalising it

If you've got any mangled capitalisation in your contact list (eg. John, JohN and JOHN), simply use:

Hi, {!fname:UCWORDS}!

This will display all first names in proper capitals ("Hi, John!").

You can also string multiple codes together using a colon. How about stripping the contact's full name down to a capitalised first name only (ie. turning "JOHN CHARLES ROBINSON" into "John")? Just use:

Hi, {!fname:FIRSTWORD:UCWORDS}!

Keep in mind you must start your multi-code sequence with either FIRSTWORD, LASTWORD or TRUNCATE!

 

Truncating your contacts' names so your SMS doesn't exceed the character limit

If you're starting off your SMS with "Hi, !fname!", E-goi will replace "!fname" with the contact's first name. However, long first names may push the remainder of your message beyond the char limit. All you need to do to prevent it is:

Hi, {!fname:TRUNCATE:8:1}!

Using the above, the contact's name will be confined to a maximum of 8 characters (including the last letter). "John" would render normally while "Sigourney" would come up as "Sigourne" so as not to impact the message's length.

 

Displaying women's clothing for females and men's clothing for males

Start by creating a segment encompassing your female contacts. Then add this condition to your email's HTML source in E-goi:

{{IF:!segment_IDSegmento=1}}

<img src="//www.example.com/images/femaleclothing.jpg" />

{{ELSE:}}

<img src="//www.example.com/images/maleclothing.jpg" />

{{ENDIF}}

Replace "SegmentID" with the ID for the female segment and you're all set! E-goi will automatically show the "femalefashion.jpg" pic to any contacts in the female segment while switching to "malefashion.jpg" for everyone not in that segment.

Instead of doing this, you can use Email Builder's conditional content, which performs the same in a visual, intuitive way.

 

 

Displaying a different discount voucher for loyal customers, one-time customers and prospects

This is quite similar to the previous example, except you should use:

{{IF:!segment_LoyalCustomerSegmentID=1}}

Thanks for being our loyal customer! Here's a little gift on us. Voucher code: AAAAAA

{{ELSEIF:!segment_OneTimeCustomerSegmentID=1}}

Thanks for your purchase. Here's a little gift on us. Voucher code: BBBBBB

{{ELSE:}}

Thanks for registering with us! Enjoy your discount voucher: CCCCCC

{{ENDIF}}

Replace  "LoyalCustomerSegmentID" and "OneTimeCustomerSegmentID" with the ID for those segments. E-goi will show the first voucher to any contacts in the loyalty customer segment, the second voucher to one-time customers and the third one to anyone not in those two segments.

Instead of doing this, you can use Email Builder's conditional content, which performs the same in a visual, intuitive way.

 

Displaying the same contents to US and UK shoppers while showing a different contents to Spanish shoppers

This is quite similar to the previous example, except you should use:

{{IF:!segment_USCustomersSegmentID=1||!segment_UKCustomersSegmentID=1}}

Hello!

{{ELSE:}}

¡Hola!

{{ENDIF}}

Replace "USCustomersSegmentID" and "UKCustomersSegmentID" with the ID for those segments. E-goi will show "Hello!" to any contacts in the US or UK segment and switch to "¡Hola!" for anyone not in any of those two segments.

Instead of doing this, you can use Email Builder's conditional content, which performs the same in a visual, intuitive way.

 

 

Frequently asked questions

 

My message doesn't include personalisation when previewing, testing or sending

The contact who received the message (or for whom you are previewing) possibly does not have information that can be personalized.

For example, if you want to personalize the greeting of the message with the contact's name (using !fname), the name will not appear if that contact does not have a name in your contact list in E-goi.