Loading

Preheader does not display for AMPScript variables in the inbox

Fecha de publicación: Oct 13, 2022
Descripción
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.
Solución

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.
Número del artículo de conocimiento

000384371

 
Cargando
Salesforce Help | Article