6 Replies Latest reply on Feb 6, 2017 3:18 PM by a018959787cca326e73392791eaf1b1f9a13a699

    Render token based off use or location, velocity/java help

      I have an email validator within a script token that appends a script to the end of the email template if it is in the preview but not on send. The issue I am having is that the token script does not render in the normal "view by: default", once I tie a lead to it via "view by: lead" the script runs fine, as expected with a script token. Can I somehow check the tokens attributes or context prior to rendering? I can get the context keys when viewing by lead or on send but how can I do it in the default preview?

       

      I'd like to force this one script token to render my validator while in the default preview window.

      simplified pseudo code since I don't know java:

      #allowMeToCheckKeys()

      #set ($thisSctiptTokensKeys = context.keys)

      // Ideally $thisSctiptTokensKeys returns and array of objects with something like [location,my,etc...]

      // then in location {where: 'default preview', render: false}

      #if ($thisSctiptTokensKeys.location.where == "default preview")

           #context.put('location.render', true)

      #end

       

      Not sure if context is even the correct place to look in velocity templates but all I've found so far. Hope this explains what I'm looking to do. Any help or relevant documentation would be appreciated.