Utilizing Merge Variables

When creating your email or mobile message, it’s always a great idea to personalize your messages as much as possible! To do this, you can use merge variables. A merge variable displays a value from a designated variable.

For example, you can use the merge variable {{firstName}} to personalize your recipients’ first names. When the email is sent, the merge variable will be replaced with the recipient’s first name.

For example, let’s say that you’re sending an email to someone named Anna. Anna’s first name is saved in Clutch along with her email address and some other demographic information. 

The email content you’ve written out like this:

Will appear to Anna like this:

Using and Testing with Merge Variables

Using Merge Variables
Merge variables will work across both scheduled and triggered emails unless specified in notes within the table below. To use a merge variable, copy and paste the variable code (including the double braces) into the body of your email.

Pro-Tip: When considering the {{firstName}} merge variable, if the customer has a first name in the Clutch database, their first name will populate. However, if no first name is present, you can set it up to populate as “Loyalty Member” (for example) as the default. This is set up as {{firstName default=”Loyalty Member”}}.

If desired, you can make changes to fill in another demographic field if the first name is not populated. For example, you can change the default to the last name by using the merge variable {{firstName default=”((lastName))”}} instead.

Testing with Merge Variables
Note that when testing emails or mobile messages, you can send tests to individual recipients or use a test list. To test any merge variables, you’ll need to send to a Test List. If you send a test to individual emails, merge variables in the email body will be left blank and therefore will NOT work for testing.

If you need help creating a Test List, you can consult the article here.

Merge Variable List

Below is a list of merge variables that may be available to you for your reference. Note that what is usable to your brand may vary depending on your integration with Clutch.

Card Details

NameVariable Code
Card Number{{cardNumber}}
Card Pin{{cardPin}}

Customer Demographics

NameVariable Code
Custom Demographics Fields*eg. {{demographics field=”preferredFragrance”}}
Address 2{{address2}}
Address{{address}}
Age{{age}}
Birthday{{birthday}}
City{{city}}
Country{{country}}
Email{{email}}
Enrollment{{enrollment}}
First Name{{firstName}}
Full Name{{fullName}}
Gender{{gender}}
Last Name{{lastName}}
Phone{{phone}}
Postal Code{{postalCode}}
State{{state}}
Zip Code{{zipCode}}

*All fields in the customer model are available. Use the name of the demographics field in the variable code. In this example, the field name is preferredFragrance.

General

NameVariable CodeNotes
Dateeg. {{date}} or {{date add=”6″ datepart=”D|W|M|Y” dateformat=”MM/DD/YYYY”}}Displays today’s date (the send date) or generates a date in the future or the past based on paramaters. Specify the type of time you want to add or remove (eg. M (month), D (days)) and the number (add = 6 or -6).
45 Days Later{{45DaysLater}}45 days from send date.
Email Confirmation Link{{emailConfirmationLink}}Generates a link to the Clutch CASL subscription confirmation page where users can confirm their subscription.
Next Month{{nextMonth}}Generates the next month from current date.
Opt Out Link{{optOutLink}}Generates a link to the Clutch hosted subscription preferences page where users can unsubscribe.
Tomorrow{{sendDateTomorrow}}Tomorrow’s date from send date.
Send Date{{sendDate}}The send date of the message.
Send Month{{sendMonth}}Current month of send date.

Location Information

NameVariable Code
Location Address{{locationAddress}}
Location City{{locationCity}}
Location Hours on Saturday{{locationHoursSat}}
Location Hours on Sunday{{locationHoursSun}}
Location Hours of Week{{locationHoursWeek}}
LocationManager{{locationManager}}
Location Name{{locationName}}
Location Owner{{locationOwner}}
Location Phone{{locationPhone}}
Location State{{locationState}}
Location Website{{locationWebsite}}
Location Zip Code{{locationZip}}
Location External ID{{location}}

Balance Data

NameVariable CodeNotes
Currency Balance by Typeeg. {{balance balanceType=”Points”}}Current balance by balance type. In this example, the balance type is Points. Other options are Punches, Cashback, Custom.
Last Purchase Date Expirationeg. {{lastPurchaseDateExpiration add=”6″ datepart=”M” dateformat=”MM/dd/YYYY”}}Calculates a future date for expiration based on the customers last checkout date. Defaults to 12 months from last purchase date. Specify the type of time you want to add (eg. M (month), D (days)) and the number (add = 6).
Next Points Rewardeg. {{nextPointsReward thresholdAmount=”100″}}Calculates how far the customer is from earning their next points reward based on current balance and threshold passed in to variable.
Next Punches Rewardeg. {{nextPunchesReward thresholdAmount=”5″}}Calculates how far the customer is from earning their next punches reward based on current balance and threshold passed in to variable.
Next Rewardeg. {{nextReward balanceType=”Points” thresholdAmount=”500″}}Calculates how far the customer is from earning their next reward based on current balance and threshold passed in to variable.
All Current Balances{{balances}} or {{balance returnType=”compact”}}All current balances in JSON format.
Current Currency Balance{{currentCurrencyBalance currencyCode=”USD”}}Current currency balance on card for given currency code.
Current Point Balance{{currentPointBalance}}
Current Punches Balance{{currentPunchBalance}}
Current Reward Balance{{currentRewardBalance balanceCode=”cashback” decimalAmount=”2″}}Current reward balance by balance type. Optional to specify number of decimal places.
Last Purchase Date{{lastPurchaseDate}}Last checkout data for customer return in MM/DD/YYY format.

Transactional Data

NameVariable CodeNotes
API Call Type{{apiCallType}}Triggered only. The API call type.
Balance Mutations{{balanceMutations}}Triggered only. The balance mutations for the current request.
External Request Reference{{externalRequestRef}}Triggered only. The value provided in the externalTransactionId header field for the current API call.
External Transaction Id{{externalTransactionId}}Triggered only. The value provided in the externalTransactionId header field for the current API call.
Old Card Number from Transfer{{oldCardNumber}}Triggered only. Displays the old card number on a card transfer transaction.
Request Reference{{requestRef}}Triggered only. The request ref of the current API call, may be used for third party integrations.
Terminal{{terminal}}Triggered only. Displays the terminal ID from the transaction.
New Card Number from Transfer{{transferIn}}Triggered only. Displays the new card number on a card transfer transaction.

Optional Parameters

NameVariable CodeNotes
Maskingeg. {{cardNumber maskValue=”4″}}Masks a variable by the number of characters specified. Masks from left to right.
Case Adjustmenteg. {{firstName caseAdjustment=”upper”}}Formats the string. Options are: upper, lower, proper and none.
Encodeeg. {{locationCity encode=”url”}}Formats the string for a url by removing spaces.
Print Friendly, PDF & Email
Updated on October 31, 2023

Was this article helpful?

Related Articles