Skip to content
Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Merge Field entry
How-to guide

Insert merge fields into a Lightning email template

You do not create a merge field as a standalone record. You insert one while building a surface that supports it. Here is how to add merge fields to a Lightning email template so the message personalizes itself per recipient.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated Jun 16, 2026

You do not create a merge field as a standalone record. You insert one while building a surface that supports it. Here is how to add merge fields to a Lightning email template so the message personalizes itself per recipient.

  1. Open the email template builder

    In Setup or the App Launcher, go to Email Templates and create or edit a Lightning email template. Set the Related Entity Type so the picker knows which object fields to offer.

  2. Place your cursor and open the merge field picker

    Click in the subject or body where the dynamic value belongs, then click the merge field button in the toolbar to open the picker.

  3. Choose the field and insert it

    Pick the recipient or related field you want, such as Contact First Name or Account Name, then click Insert. The builder writes the correct token, like {!Contact.FirstName}, for you.

  4. Add a fallback for empty values

    For fields that might be blank, wrap the reference so a default shows instead, so a missing first name reads as a friendly word rather than nothing.

  5. Preview with a real record and save

    Use the preview option against an actual record, confirm every token resolves, then save and activate the template.

Related Entity Typeremember

Sets which object the template targets so the merge field picker lists the right standard and custom fields.

Recipient fieldsremember

Merge values from the primary recipient, the lead, contact, or person account the email is sent to.

Related record fieldsremember

Merge values from associated records like Account, Opportunity, Campaign, or Case linked to the recipient or the Related To record.

Org and user globalsremember

Insert {!$User.FirstName} or {!$Organization.Name} to add running-user and company context without a lookup.

Gotchas
  • Field-level security still applies, so a field the sender cannot see renders blank for them even though it exists on the record.
  • An empty field or missing relationship produces an empty string, not an error, which is how you get output like Dear , with the name gone.
  • Cross-object references only reach so many relationship hops, and they traverse to parent records, not down to child records.
  • Hand-typed API names fail silently on a typo, so always insert through the picker rather than typing the token yourself.

See the full Merge Field entry

Merge Field includes the definition, worked example, deep dive, related terms, and a quiz.