cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript Console

drbaz
Champ in-the-making
Champ in-the-making
I wish to send an e-mail using a javascript and a Freemarker Template.

I can send an e-mail via my javascript using the Javascript Input tab of the Console.

I have tried using the "Freemarker Input" and I can see "Freemarker HTML Output" if I use the ${companyhome} type nodes; but I get an error if I used the ${space},${space.name}, ${document} etc nodes.
Error is:
<strong>
500 Internal Error
An error inside the HTTP server which prevented it from fulfilling the request.
03240034 Wrapped Exception (with status template): 03241463 Error during processing of the template 'Expression space is undefined on line 1, column 7 in string://fixed.'. Please contact your system administrator.
</strong>
What am I doing wrong? Should I pass nodes to the "FreeMarker Input" template from my javascript? If so, how?



1 REPLY 1

drbaz
Champ in-the-making
Champ in-the-making
Add all the data you want to display in a Freemarker template to the "model" variable in your JavaScript

model.myVar = "This is my variable";

then you can use…

${myVar}

.. in the template and in the Freemarker Input tab of the JavaScript Console

Many thanks to Florian Maul of FME for providing the support and solution