Loading

Preheader does not display for AMPScript variables in the inbox

Date de publication: Oct 13, 2022
Description
AMPScript variables used in the preheader won't render in the inbox if positioned in the body tags. They will render in preview and test, but when the email is sent it won't render the value of the variable.


Example

Preheader : Welcome %%=v(@firstname)=%%

HTML:
<html>
<body>
%%[
SET @firstname='Alex'
]%%
</body>
</html>

After sending the above Email, the preheader value won't render in the inbox.
Résolution

When the email is compiled to be sent, we place the preheader block directly after the opening <body> tag.

In order to have the preheader variables render for live sends, your AMPScript block that sets these variables must be placed before the opening <body> tag.


Example

Preheader : Welcome %%=v(@firstname)=%%

HTML:

<html>
%%[
SET @firstname='Alex'
]%%
<body>
Insert some email content here
</body>
</html>

The preheader value will render in the inbox.
Numéro d’article de la base de connaissances

000384371

 
Chargement
Salesforce Help | Article