I am aware of the bug about the preheader which is not displayed once the email is sent. I would like to render a dynamic preheader based on a field on a DE. My email is structured as follows: I have a code snippet block where I have all the rules to display the content and then the Body starting from the web version link. I do not have the tag html but I have the tag table. I tried to insert the ampscript where I set the preheader before this tag but it seems to not work.

1 Answer 1


If you are using a code snippet block in content builder, it most probably is placed as part of the body. The platform is automatically injecting the preheader value directly after the tag, so anything defined AFTER the initial tag will not be able to be referenced by your preheader field.

Imagine you set the preheader value in content builder as %%=v(@preheader)=%%, you will need to define this variable BEFORE the tag. This is why your ampscript should be set as part of the template, and not a draggable content block into the actual body of the email.

  • Many thanks. My template is fixed for every communication and I cannot modify it because, as I said, to define the preheader I use the lookup in a specific DE which changes for every communication. Is there any workaround? Thanks
    – Maria
    Commented Feb 7 at 13:41
  • You might want to check this discussion and the explanation by @Gortonington and @Adam Spriggs Commented Feb 7 at 13:59
  • Many thanks, I created a new content block containing almost all the email code and I recalled it in the Preheader space using ContentBlockById. I correctly see the preheader on Outlook app mobile and Gmail App and web but if I open the email in Outlook app desktop the preheader line is at the top as if there is a new block part of the email
    – Maria
    Commented Feb 7 at 15:57
  • @Maria I don't think putting your entire email code in the preheader is that good of an idea.... You should only include the code generating the preheader - it will automatically be injected just after BODY tag. The rest should indeed just be left in content blocks. Commented Feb 7 at 16:37
  • Yes, I inserted only the code which generates the preheader. However, in Outlook app desktop the preheader appears at the top of the email
    – Maria
    Commented Feb 8 at 8:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .