parse error unexpected token invalid token merge field error placeholder error curly braces column name wrong syntax error

Why am I seeing "ParseError: unexpected token"?

Learn how to resolve the "ParseError: unexpected token" in SecureMailMerge caused by invalid merge fields or incorrect placeholder syntax in Outlook.

What This Error Means

The template contains an expression the mail merge engine cannot read. Check the token or condition named in the error rather than changing every field in your email.

How to Fix It

Check your token syntax

Every personalization token needs:

  • Two curly braces on each side: {{FirstName}} not {FirstName}
  • Correct column name spelling, capitalization does not matter. Spaces in a header are supported.

Common mistakes

WrongCorrect
{FirstName}{{FirstName}}
{{FirstNmae}}{{FirstName}} (if your column is “FirstName”)
{{Date(s)}}{{ ["Date(s)"] }} (quote special characters)
{% if Plan == "Premium" %} with no closing tagAdd {% endif %} after the conditional content

These are valid: {{firstname}} for a FirstName column, {{ FirstName }}, and {{ First Name }} for a First Name column. You can also write {{ ["First Name"] }}.

The safest way to insert a field is to select it from the add-in’s column dropdown and use “Add to body” or “Add to subject”. If the error is in a condition, check its quotes and closing tag in the conditions guide. Formatting part of a condition tag can also break it; format the content inside the block instead.

How to check your column names

  1. Open your spreadsheet
  2. Look at the first row, these are your column names
  3. Check the spelling of the column referenced by the error, then send yourself a fresh test

Need more help?

Email support with what you were trying to do, what happened and the exact error message. Do not include real recipient data.