Ive created a data extension with several attributes , one of them being pre header. This is where my content lies. When I add ampscript in my email it pulls the pre header however when I do the real send it does not show

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Mar 28 at 6:25

1 Answer 1


You need to set the value of your dynamic preheader in HTML before your opening tag, like this:

Preheader : %%=v(@preheader)=%%


    SET @firstname='Alex'
    SET @preheader = Contact('Welcome ',@firstname)
    Insert some email content here

Source: Salesforce Documentation

If you want to avoid showing the actual content of the email, you can add this fix, to add whitespaces just after the preheader. It will "push" the actual email content further into the email, so you avoid showing it in inbox list view:

IF _messagecontext == 'SEND' THEN
    SET @preheaderLength = length(@preheader)
    SET @maxLength = 120
    SET @spaceFill = subtract(@maxLength, @preheaderLength) 
    FOR @counter = 1 to @spaceFill do 
        SET @preheader = CONCAT(@preheader,'&#847;&zwnj;&nbsp;') 

This one is based on this good article from Litmus

  • Thank you! It worked however after the pre header I see the Main text string showing after I just want the Subject line and pre header to show before opening mailer
    – Molo
    Commented Mar 28 at 10:52
  • Sure, @Molo - please see my updated answer. And don't forget to mark my answer as accepted if it has been helpful. Commented Mar 28 at 11:31

You must log in to answer this question.

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