Can a script token reference a user-set local variable inside a module

Anonymous
Not applicable

Can a script token reference a user-set local variable inside a module

I am currently getting a runtime error, so I am certain I am not going about this exactly the right way.

"An error occurred when procesing the email Body!

Lexical error, Encountered: "t" (116), after : "." at *unset*[line..."

I have a local variable value set by the user (or set to a default) that I want to reference and then append to it. Is something like the following possible?

Velocity script inside the token:

#if (${summaryLink}.contains('?'))

     ##already has a param string, so append mine

     ${summaryLink}.concat('&source=')

#else

     ${summaryLink}.concat('?source=')

#end

So for example, inside the email template I want to have the script process the outputted value of the variable ${summaryLink}:

{{my.dynamicURLFormatting}}

<a href="${summaryLink}{{my.trackingToken}}">...whatever...</a>