Loading

Blank Merge Field in Salesforce HTML Email Template

Publiceringsdatum: May 2, 2026
Beskrivning

In Salesforce, a merge field is a placeholder (for example, {!Object__c.Field__c}) that pulls data from a record directly into an email template. When an HTML email template is sent, a merge field may display as blank even when the corresponding record field is populated. This occurs when the merge field code in the template contains hidden HTML formatting tags that corrupt the merge field syntax.


You can verify this by highlighting the merge field in the email template preview, right-clicking the selection, and choosing View Source, View Page Source, or Inspect Element. For example, the merge field code in the template appears as {!Object__c.Field__c} but when viewing the HTML source, the actual code is {!Object__c.Field__c</font><font size="2">} — the hidden HTML tags break the merge field.

Lösning

To fix a blank merge field in a Salesforce HTML email template, delete the corrupted merge field code and re-add it cleanly using the Available Merge Fields menu. This removes any hidden HTML tags embedded in the field code.

  1. Open the HTML email template in edit mode.
  2. Locate and delete the merge field code from the template body.
  3. In the Available Merge Fields menu, select the correct field.
  4. Copy the merge field value from the menu and paste it into the email template at the desired location.
  5. Save the template and test by sending a preview email to confirm the merge field populates correctly.


See Also:
Email template does not merge the fields from a related list.
Cross-object merge fields do not work in email templates.

Knowledge-artikelnummer

000387898

 
Laddar
Salesforce Help | Article