Create an Email Script Token create-an-email-script-token

For advanced developers, you can use Velocity scripts in your emails. Here’s how to do it.

  1. Go to Marketing Activities.

  2. Find and select any program (Event, Default, or Engagement, etc.).

  3. Under the My Tokens tab, drag in an Email Script token.

  4. Name your email script token and click to edit its content.

  5. Use the tree on the right to drag in Person, Opportunity, or Custom Object tokens.

    note note
    NOTE
    When accessing an array (opportunity or custom object) you are limited to the most recent 10 items associated to the person.
  6. Notice the token becomes checked/active after you drag it into the script editor.

    note note
    NOTE
    If you are typing in tokens free-form ensure to check/activate all corresponding tokens in the tree or they will be treated as plain text and won’t work.
  7. Write your script in Velocity. Here are some useful resources:

  8. Once your script is completed, click Save.

  9. Click Save one more time.

Now you can use this token in your emails. It will run the script every time an email is sent.

recommendation-more-help
94ec3174-1d6c-4f51-822d-5424bedeecac