Understanding placeholders in custom HTML templates

If you build your email outside of Sendigram, for example in an HTML editor or with an agency, your HTML file does not know anything about the campaign it will be sent in. Placeholders solve this. A placeholder is a short tag in double curly brackets, such as {{Preheader}}. When the email is sent, Sendigram replaces each placeholder with real content: the subject line you set up in the campaign, the preheader, the contact's name, a link, and so on.

Why placeholders matter

  • Your HTML stays reusable. You can use the same file in many campaigns and change the subject or preheader in the campaign settings instead of editing the code.
  • Sendigram can add the elements that must be generated for each recipient, such as the unsubscribe link and personalization.
  • If a placeholder is missing from your code, the matching element simply will not appear in the email (see "What happens if a placeholder is missing" below).

Placeholders you can use

Placeholder What it does Where the value comes from
{{Subject}} Inserts the subject line. The Subject field in the Email template block of the campaign.
{{Preheader}} Inserts the preheader, the preview text shown next to the subject in the inbox. The Preheader field in the Email template block of the campaign.
Personalization tags, for example {{First Name}} Inserts contact data such as first name, last name, country or city. Contact attributes. Use the Personalization icon in the Subject or Preheader field to see the exact tag format.
"View in browser" link placeholder Creates a link that opens the web version of the email. Generated by Sendigram for each email.
Unsubscribe link placeholder Inserts the personal unsubscribe link of each recipient. Generated by Sendigram for each email.

How to use placeholders in your HTML

  1. Open your HTML file in a code editor.
  2. Place each placeholder exactly where you want the content to appear. For example, put {{Preheader}} in the hidden preview-text block at the very top of the email body, and the "View in browser" link in the header.
  3. In Sendigram, create or open a campaign and go to the Email template block.
  4. Select Custom HTML, then paste the code or upload the HTML file.
  5. Fill in the Subject and Preheader fields in the same block.
  6. Check the preview and send a test email to see the placeholders replaced.

How Sendigram replaces placeholders

  • When the system finds a placeholder in your code, it takes the value from the campaign settings (or from the contact's profile for personalization tags) and inserts it at the moment of sending.
  • The replacement happens for every recipient separately, so each contact sees their own data and their own links.
  • Placeholders are case-sensitive and must be typed exactly as shown, including the double curly brackets. A tag with a typo is not replaced and may appear in the email as plain text.

What happens if a placeholder is missing

  • {{Subject}} is missing: Sendigram uses the subject line coded in your HTML file, if there is one.
  • {{Preheader}} is missing: the preheader you entered in the campaign is not shown. Inboxes will then display the first visible text of the email instead.
Still have questions?