I've been trying to implement Sanford Whiteman's post "Use Javascript within Velocity" from late 2017 to utilize Javascript in an Email Script Token, and when following the example verbatim, instead of outputting the Lead's firstname
Kenneth
playfully as
K e N n E t H
, the actual Velocity code is output in the email:
$JSEngine.put("lead", $lead) $JSEngine.get("spacedOutInJS")
Attached are screenshots showing:
Am I missing something here?
Kenneth Soldink
Just came across this https://nation.marketo.com/docs/DOC-6953 which probably means that this is not supported anymore...
Correct, this and many other advanced techniques were disabled at that time.
In fairness, though, this is more of a frill (as opposed to other important techniques that have no equivalent now). What exactly are you trying to do with your data that required JS?
I was originally aiming to generate a Base64 string from small JSON string that contains some default and custom fields, as well as a timestamp, to append onto links. I can go a different route, but this was nice as it afforded my endpoint some simplicity in interpreting the string.
Does Rhino even support btoa?
Anyway, Bae64 used to be possible without calling the JS engine, but that method got thrown out w/the bathwater as well.