Skip to main content
Level 5
May 15, 2026
Solved

Use of dollar amount token in email preheader

Hi Team,

I have a Velocity token created in Marketo that you previously helped with to display a dollar amount, round it off, and calculate it as 10% of the revenue. The token works perfectly when added within the body of the email.

#set( $tenPercent = $number.integer( $math.mul( $lead.personLevelEngagementScore, 0.1 ) ) )
${number.format("${esc.d}${esc.h}${esc.h},${esc.h}${esc.h}${esc.h}", $tenPercent)}

When I wanted to display the same value in the subject line, adding a $ before the token worked successfully. However, I now need to use the same token in the preheader, and neither adding just the token nor adding a $ before the Velocity token seems to work there.

I’m not sure if there’s a limitation with preheaders or if there’s another approach required to make this work. Could you please help guide me on this?

Regards,
Akshat

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
May 22, 2026

 

6 replies

SanfordWhiteman
Level 10
May 15, 2026

The deal with Velocity in preheaders is complex. Due to order of operations, Velocity {{my.tokens}} don't work, but raw Velocity does. But using the a lead field in that raw Velocity has a trick to it. I’ll write a blog post on it this weekend.  

Translate
ashah123Author
Level 5
May 15, 2026

Thanks ​@SanfordWhiteman . Looking forward to it . You are always very helpful and your blog articles and details are really useful always :)

Translate
ashah123Author
Level 5
May 21, 2026

​@SanfordWhiteman Would you be able to share the blog link related to using Velocity Script in the preheader?

Translate
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
May 22, 2026

 

Translate
ashah123Author
Level 5
May 22, 2026

Thanks ​@SanfordWhiteman I will take a look at it and let you know the results !!

Translate
ashah123Author
Level 5
May 27, 2026

​@SanfordWhiteman Your solution worked perfectly , thanks alot for sharing this , its really helpful !!

Translate