Skip to main content
June 4, 2017
Question

Referencing local tokens in an email Velocity email script token

  • June 4, 2017
  • 1 reply
  • 3407 views

Is there a way to create a velocity email script token (is there a way to write a Velocity script) that can call on any other tokens, i.e. text my.tokens in the same program?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
Level 10
June 4, 2017

Velocity can access variables (VTL references) set in other Velocity {{my.tokens}} embedded in the same email asset (they don't technically have to be from the same program, they can be inherited).

It can't access text or other {{my.token}} types.

In Velocity-heavy environments it's common to create "data tokens" like so:

#set( $myVeloVar = "Some text" )

Then you can use that reference in other, later tokens:

$myVeloVar

There are even ways to embed data blocks without a literal #set statement but they're rather far afield.

June 6, 2017

Thank you for your response and knowledge!

shawn