Understanding and Using Mail Merge to Personalise Your Campaign

Understanding and Using Mail Merge to Personalise Your Campaign

Mail merge allows you to personalise the content of your campaign by inserting values related to the recipient. The most common mail merge is the first name. This allows you to say personally address the receiver of your email or sms campaign. 

Every contact field can be used in a mail-merge and a fallback value is also supported.

Fallback values in mail merge denote text to display when the value of the specified field is empty.
For example, if you send an email containing " Hi {contact.firstName} " and you do not have the user's first name then, they will just see " Hi ". 
A fallback value allows you to provide a value so that if the first name isn't available, the platform will use generic text (eg: "Hi there" or "Dear Member")

How to insert a mail merge in a campaign
‚Äč
When editing any text within the platform, if mail merge is supported, a button or a link will exist to allow you to select a mail-merge using a popup interface. 
Mail-merge is supported in the following areas:
  1. Email content & subject lines
  2. SMS content
  3. Automation notification emails & sms.
  4. Form notification emails & sms.
  5. Pushing webhooks to third-party systems.




Understanding Mail Merge Parsing
As well as using the "Insert A Mailmerge Tag" page, you can also type out any mail-merge you wish to use. Mail merge tags are all formatted in the same way: 
 { module . field | fallback

Any text within curly brackets { }   will be interpreted as mail-merge tag. The platform will then read and attempt to parse the text inside the curly brackets and display a value. 
The modules available are based on your account package and settings. They can be one of:
  1. contact - all data stored in your database
  2. transaction - purchase and transaction data that has been captured from integrations (eg: from ePOS, ticketing platforms etc...)
  3. visit - booking and reservation information captured from integrations
  4. whitelabel - only available to white label account holders to display details of the platform settings.
  5. offer - to display an offer barcode or value
  6. campaign - for use in email campaigns to display personalised links (eg: unsubscribe, view online etc...)
Immediately after the module name, specify a full stop followed by the field name . Field names are dynamic based on the available fields that have been setup per that module. 
If you wish to specify a fallback, you will need to add a pipe (|) character followed by your fallback text

Here are some examples:
  1. To display first name or "member" if no value: {contact.firstName | member}
  2. To display the email address without a fall back value: {contact.email}
  3. To display the date of the user's last transaction: {transaction.transactedAt}
  4. To display the all time amount of money spent by the user: {transaction.allTimeTotal} 
If a specified field does not exist within a module then, the full text will be displayed as-is. For example, if specifying a mail-merge as {contact.Age} and no such field called "Age" exists then, your campaign will display "{contact.Age}" rather than blank text. 

Displaying Today's Date
A special mail merge {date.now} exists to display the current date and time. For email or sms campaigns, this will be the date & time that the campaign was sent to the receipient.
All date formatting and modifiers can be applied to the {date.now} mail merge.


Date and Time Formatting
By default, when specifying a date or time field, the platform will output the full value using the formats:
  1. Date fields will be displayed as dd/mm/yyyy or mm/dd/yyyy based on your account locale. 
  2. Time fields will be displayed as hh:mm
  3. Date & Time fields will be displayed as dd mmm yyyy hh:mm (month and day may be reversed based on locale).
However, in certain situations, you may wish to display only a portion of the date. In such cases, you are able to specify a full stop after the field name and then enter "day", "month" or "year" to display only that part of the date. 

For example, if the Date of Birth is 20 December 1985, we can use the following mail-merge tags:
  1. {contact.dob} will display 20/12/1985 (or 12/20/1985 based on locale)
  2. {contact.dob.day} will display 20 .
  3. {contact.dob.month} will display Dec.
  4. {contact.dob.year} will display 1985.
As well as day/month/year, we also support the ability to provide very custom and specific formatting rules for date and time formatting. You can specify a string of tokens after your field name to specify the exact format of your date display. These can all be used together. 

Supported Date formatting tags are:

Type
Token
Output
Type
Token
Output
Month
M
1 2 3 .... 11 12
Day of Week
dd
Su Mo Tu ... Fr Sa
Month
Mo
1st 2nd 3rd...11th 12th
Day of Week
ddd
Sun Mon Tue ... Fri Sat
Month
MM
01 02 03 .... 11 12
Day of Week
dddd
Sunday Monday....Saturday
Month
MMM
Jan Feb ... Nov Dec
Year
YY
70 71 72 ...29 30
Month
MMMM
January February...December
Year
YYYYY
1970 1971 ...2029 2030
Day of Month
D
1 2 3 .... 30 31
Day of Year
DDD
1 2 3 4 ....364 365
Day of Month
Do
1st 2nd 3rd ...30th 31st
Week of Year
w
1 2 3...52 53
Day of Month
DD
01 02 03 ... 30 31
Quarter
Qo
1st 2nd 3rd 4th

Supported Time formatting tags are:

Type
Token
Output
AM/PM
a
am pm
AM/PM
A
AM PM
Hour
H
0 1 2 3....22 23
Hour
HH
00 01 02 03 .... 22 23
Hour
h
1 2 3 ... 11 12
Hour
hh
01 02 03 .. 11 12
Hour
k
1 2 3 4 .... 23 24
Hour
kk
01 02 03 04 .... 23 24
Minute
m
1 2 3 4 ....58 59
Minute
mm
01 02 03 ... 58 59
Second
s
0 1 2 3 ...58 59
Second
ss
00 01 02 03 ... 58 59


Date and Time formats can be used together or separately. 
For example: Assuming that we have a date/time contact field called "lastTransaction" with a value of June 11 2020 3.30pm.
We can use mail-merge to display it as follows:

Mail Merge specified in our campaign
What the user will see
{contact.lastTransaction}
11/06/2020 3.30pm (day & month will be reversed based on locale)
{contact.lastTransaction.day}
11
{contact.lastTransaction.month}
Jun
{contact.lastTransaction.year}
2020
{contact.lastTransaction.dddd}
Thursday
{contact.lastTransaction.MMMM}
June
{contact.lastTransaction.dddd Do MMMM}
Thursday 11th June
{contact.lastTransaction.MMM Do h:m a}
Jun 11th 3:30pm


Performing Date Calculations
Any date, date/time and {date.now} tag can have a date calculation performed at the time of send.
This can be great to use to display a value such as an expiry or renewal date that might be automatically calculated as 12 months from the join date. 

There are two supported calculation operators: add (denoted as " + ") and subtract (denoted as " - "). Calculations can be performed using days, months and years. 

The calculation needs to be placed immediately after the field name within the mail-merge tag. The format is " [+/-]<number>[ymd] "


Format Examples:
  1. {date.now+1y} = add 1 year to the current date  
  2. {date.now-1y} = subtract 1 year from the current date
  3. {date.now+1m} = add 1 month to the current date
  4. {date.now-1m} = subtract 1 month from the current date
  5. {date.now+1d} = add 1 day to the current date
  6. {date.now-1d} = subtract 1 day from the current date


Let's put it all together.
Assuming we want to send out an email containing a voucher when a member has a birthday approaching. We would like this voucher to be valid from the day it was received until 14 days after the member's birthday.

Our campaign content might look something like:
   Hi {contact.firstName|there},
   We noticed that your birthday is coming up on the {contact.dob.Do} of {contact.dob.MMMM} and to help you celebrate, 
   we would like to offer you $20 off from our store.
   Simply use the code {voucher.offer20off.code} at checkout.
   This code is valid from {date.now.Do MMMM} until {contact.dob+14d. Do MMMM}
   


The above will render and display as:

   Hi Andy,
   We noticed that your birthday is coming up on the 10th of December and to help you celebrate, 
   we would like to offer you $20 off from our store.
   Simply use the code ABC321 at checkout.
   This code is valid from 10th December until 24th December.
   














    • Related Articles

    • Understanding Campaign Statistics

      Before you look at your campaign results you should have an understanding of what the metrics are. Once you know what each area is, you will be able to gauge how well your campaign has performed. You will also glean additional insight on your ...
    • Create an Email Campaign

      Email campaigns are a great way to communicate with your prospects and customers. It is a popular and cost effective method of direct marketing, which allows you to convey your message and your brand. For this reason, we recommend utilising email ...
    • Create a SMS Campaign

      SMS is a great way to communicate to your contacts on an instant basis. SMS/Text can be used for marketing and transactional uses. Some examples of sms use-cases include: Reminders Time Sensitive Offers Special Events Last minute event updates Urgent ...
    • Delete a Channel from a Campaign

      To delete a channel that has been set up but not sent, locate the campaign to edit by using the Campaign View, Folder View of Search Feature. Click the Edit button on the right side of the screen A popup box will appear listing all channels within ...
    • Edit an Existing SMS Campaign

      To edit an existing campaign go to the Campaign section  Locate the campaign you would like to edit via the Campaign View, Folder View of Search Feature Click the Edit button next to the relevant campaign