liquid syntax error tokenization error invalid range syntax special characters parentheses in token column name error merge field error template error syntax error token error

Why am I seeing "Error in liquid syntax"?

How to fix the TokenizationError caused by special characters like parentheses, slashes, or colons inside personalization tokens.

Contents

What This Error Means

SecureMailMerge uses the Liquid template language to process your personalization tokens. Liquid treats everything inside curly braces (e.g. {{…}}) as code, not plain text. When a column name contains special characters, Liquid tries to interpret them as programming operators and fails.

For example, if your spreadsheet has a column called Date(s) and you type {{Date(s)}} into your email, Liquid sees:

  • Date — a variable name
  • (s) — what looks like a function call or range expression

This triggers the error:

TokenizationError: invalid range syntax

Characters That Cause This Error

The following characters have special meaning in Liquid and will cause errors when used inside curly braces:

CharacterWhat Liquid thinks it means
( )Range expression or grouping
/Division operator
:Filter argument separator
+ - *Arithmetic operators

So a column named Date(s) or Day(s)/Date(s): will break because Liquid tries to parse these characters as code.

How to Fix It

The easiest fix is to use the personalization token dropdown in SecureMailMerge instead of typing the token manually. The dropdown automatically wraps column names that contain special characters in the correct escape syntax:

{{ ["Date(s)"] }}

The square brackets and quotes tell Liquid to treat the entire string as a column name rather than code. Simply select the column from the dropdown and click the button to insert it into your subject or body.

Option 2: Fix the syntax manually

If you prefer to type tokens yourself, wrap column names that contain special characters in ["..."]:

WrongCorrect
{{Date(s)}}{{ ["Date(s)"] }}
{{Day(s)/Date(s):}}{{ ["Day(s)/Date(s):"] }}
{{Time(s):}}{{ ["Time(s):"] }}

Option 3: Rename your spreadsheet columns

You can avoid this issue entirely by renaming your columns to use only letters, numbers, and underscores:

BeforeAfter
Date(s)Dates
Day(s)/Date(s):Day_Dates
Time(s):Times

After renaming, simple tokens like {{Dates}} will work without any special syntax.