Why Liquid template errors stop emails from sending
4 min read
A message that stays undelivered is hard to notice because nothing bounces and nobody complains. In Customer.io, one common cause is a Liquid tag that points to an attribute the person does not have. Customer.io's documentation uses a missing name attribute as its example: the customer's name attribute was missing, so Customer.io could not render and send the email.
How a missing attribute stops a send
This is the part that surprises people coming from another platform. In standard Liquid, a tag pointing at something that does not exist renders as an empty string and the message goes out with a blank in it. Customer.io does the opposite. Its Liquid guide states that messages will fail to send if they include data that does not exist, and explains why: "This is to prevent people from receiving incomplete messages." The message shows as Failed in your logs.
That makes a missing attribute a delivery problem rather than a cosmetic one. There is no awkward "Hi ," in anyone's inbox, and there is also no send — which is why the issue never appears in open or click rates and only surfaces in the Failed count.
The usual cause is a naming mismatch. A template that uses {{ customer.firstName }} finds nothing on a profile that stores first_name. Every person who goes through that template meets the same mismatch, in broadcasts and in flows alike.
How to prevent Liquid render errors
Match the names to the profile. Customer.io reads attributes in the form
{{ customer.<attribute_name> }}, where the name is the attribute saved on the person. Settling those names is part of the data cleanup that comes with a Customer.io implementation.Add a fallback. The
defaultfilter supplies a value when the attribute is missing.
Here is the same greeting before and after both steps. The first line reads a name the profile does not store; the second reads the stored name with a fallback behind it.
Check which version of Liquid your workspace runs before you rely on that filter. Customer.io states that the default filter only works with its latest version of Liquid, and that the version used to render your Liquid depends on when you created your account. On legacy Liquid the fallback is an if statement with a != blank check:
A fix written with default on a legacy workspace does not warn you. It simply does not take.
Fixing the names comes first, and the order matters. A fallback covers a person with no value saved, and it does not repair a wrong attribute name. If the template points at firstName on every profile, every profile receives the fallback, and a greeting of "there" goes to people whose names you hold.
How to test a template before you send it
Customer.io lets you pick a person in the Sample Data panel of the email editor, and the test send replaces customer Liquid statements with that person's data. The visual editor's preview works the same way under Previewing as, and Customer.io advises previewing people who have your attribute data and people who do not, so you can see how the fallback content renders.
A useful pair is one person with a first name and one without. The first preview should read "Hi Maria," and the second "Hi there,". In the visual editor, a Liquid syntax problem appears as "Errors found" in red at the top of the preview. The code composer surfaces the same class of problem differently, through a Review Errors button that turns red and opens a list of what it found — Customer.io documents those messages, including the "Variable is missing!" case.
Where to look for the pattern
The Failed count in your delivery metrics is where unsent messages show up. Customer.io's page on failed and attempted messages lists a Liquid tag among the reasons a message does not reach the delivery provider, and deliveries with a status of Attempted or Failed can be retried once the template is fixed.
A cluster of Failed messages from one broadcast or flow points to a template. A few scattered ones point to individual profiles with gaps in their data — the composer errors page names that case directly, noting that you may see a missing-variable error when only some people in your workspace have the attribute you are using.
What Liquid and fallbacks are
Liquid is the template language that inserts profile data into a message, and a fallback is the value used when that data is absent. The default filter in Liquid generally fills in a value when a variable is nil, false or empty — the false case catches people out, and Shopify's allow_false parameter exists for it.
Platforms differ, and the difference that matters most is the one above: where standard Liquid renders a blank and sends, Customer.io fails the render and holds the message. Your own ESP's documentation has the behavior that applies to you.
The bottom line
A message with a Liquid error is a send nobody sees, and the cause is usually a name that differs between the template and the profile. Matching the attribute names and adding a fallback covers both situations — using the fallback syntax your workspace's Liquid version actually supports — and a preview with and without the attribute shows the result before the send. If you would like a second set of eyes on your templates, our Customer.io team is happy to take a look.



