2

Does anyone know why AMPscript variables won't work in the preheader? They will resolve in the send preview, but once the email is delivered they are blank.

If I use the same variables in both the subject line and preheader, the subject line variables resolve but the preheader variables do not once the email is delivered. This does not make sense to me and seems like a bug in SFMC. Wondering if anyone has a solution or work around.

These are ampscript variables... so the syntax is like this:

This is my variable: %%=v(@var)=%%

  • Are you initializing @var before assigning it? E.g. var @var set @var = "whee". – Adam Spriggs Jan 19 '16 at 13:36
3

The issue is that in the fully built email the AMPscript block that sets the preheader variables is placed farther down in the file than where the preheader gets inserted.

SFMC will place the preheader block directly after the opening <body> tag. In order to have preheader variables render after the email deployment, your AMPscript block that sets these variables must be placed before the opening <body> tag. I put the block directly after the opening <html> tag.

| improve this answer | |
1

Perhaps this is the issue: missing <head></head> tags in your email.

Preheader doesn't render in a Marketing Cloud email

Found via findsf.info

Update

Relevant post: Create dynamic preheader in exacttarget

| improve this answer | |
  • Thanks for the reply, this is pretty close but I figured out my issue which was something slightly different. – Jon Sakas Jan 22 '16 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.