Skip to content

Instantly share code, notes, and snippets.

@fmquaglia
Last active December 11, 2015 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmquaglia/fab87df2ba85aeb1a818 to your computer and use it in GitHub Desktop.
Save fmquaglia/fab87df2ba85aeb1a818 to your computer and use it in GitHub Desktop.
question to Ravi

Passing parameters to an email script token

Is there a way to "pass a parameter" to an email script token?

We would like to pass a string to an email script from the email definition, in the same way the user defines a default value for the token, and thus be able to use that string in the velocity script.

Let's say we have an email script token called my.foo

This hypotetical token is meant to be used in the email by passing a "parameter" (let's suppose we call this parameter bar)

Like this:

In the email:

{{my.foo:bar=Hello World}}

In the velocity script:

<p>You passed: <strong>$bar</strong</p>

To get in the email text something like:

You passed: Hello World

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment