Sub topic 6
Personalising subject lines and preheaders
This chapter assumes you can insert a merge tag into a template and set a fallback value for a missing field. Here you apply those skills to the two pieces of text that decide whether an email gets opened: the subject line and the preheader.
Where this text appears
The subject line is the headline shown in the inbox list. The preheader is the short preview text shown after it. If you don't set a preheader, most mail apps pull the first visible text from the email body, which is often "View in browser" or a row of navigation links.
Subject lines and preheaders are plain text. This changes what you can do with them:
- Merge tags and simple filters work in both.
- Conditional logic usually works, but only on platforms that render the subject through the same template engine as the body. Check this before relying on it.
- HTML does not work. Anything a field contains is shown literally.
Personalising the subject line
A first-name tag is the simplest case. Always add a fallback, because a subject line that reads "Sam, your order shipped" is good and one that reads ", your order shipped" is a visible failure.
{{ customer.first_name | default: "Hi" }}, your order has shippedIf the first name is missing, this still reads naturally as "Hi, your order has shipped". Choose fallbacks that fit the sentence, not just the field. "there" works after "Hi" but not at the start of a subject.
Names are only one option. Fields such as plan, city or the product a contact last viewed often give a more useful subject than a name does.
{% if customer.plan == "free" %}Unlock priority support{% else %}Your Pro benefits this month{% endif %}Keep the output on one line. Line breaks inside a subject tag can become stray spaces or be stripped, depending on the platform.
Writing the preheader to work with the subject
Treat the subject and preheader as one message. The subject carries the main point and the preheader adds a detail. Repeating the subject wastes the space.
Subject: {{ customer.first_name | default: "Hi" }}, your order has shipped
Preheader: Arriving {{ order.delivery_date | default: "in 3 to 5 days" }}The preheader fallback is a phrase that is true for every recipient. A vague but correct line is better than an empty gap or a wrong date.
Common failure points
| Problem | Cause | Fix |
|---|---|---|
| Subject begins with a comma or space | Empty field with no fallback | Add a default |
| "SAM" or "sam" in the subject | Data entered in capitals or lowercase | Normalise the data or apply a capitalisation filter |
| Subject cut off in the inbox | Personalised value is long | Test with the longest realistic value |
| Raw tag text such as `{{ customer.first_name }}` shown | Tag syntax not supported in that field | Check the platform's documentation |
| Special characters appear as `&` | Field is escaped for HTML | Use the platform's raw or unescaped option for plain text |
Length matters because inboxes show only roughly 30 to 60 characters of a subject, depending on the device. Put the personalised part near the start only if it is short. A long value such as a company name can push the actual message out of view.
Restraint
Personalisation can feel intrusive when it shows more than the subscriber expects. A subject that names a product they browsed once may feel like surveillance. Use only data the subscriber knowingly gave you, and prefer details that help them, such as a delivery date, over details that only show you are tracking them.
Flow of a personalised subject
Exercise
A contact has no first name on file. Your subject template is {{ customer.first_name }}, your trial ends soon. What does the contact see, and how would you rewrite the template so it reads well?
Show answer
They see ", your trial ends soon", which starts with a comma. Add a fallback that fits the sentence, for example {{ customer.first_name | default: "Hi" }}, your trial ends soon, which renders as "Hi, your trial ends soon".
Exercise
Why should a preheader fallback be a phrase that is true for every recipient?
Show answer
When the field is missing, the fallback is shown to every affected contact. If it states something specific that may be false, such as a particular date, some recipients receive wrong information. A general but accurate phrase is safe.