Hello Henning,
thanks again. I actually woke up last night and figured it out myself
(believe it or not)! I was a little confused, because you assign the
context with a new variable.
Thanks a lot,
Sven.
Henning P. Schmiedehausen schrieb:
Sven Richter <[EMAIL PROTECTED]> writes:
Hello (again),
I added your suggestion:
VelocityHtmlEmail vemail = new VelocityHtmlEmail(data);
Context ctx = /TurbineVelocity.getContext/(data); /
ctx.put/("vmail", vemail); /
ctx.put/("bestellung", oData);
/vemail.addTo/("emailaddress", "Sven Richter");
///data.getUser/().getEmail());
/vemail.setFrom/("Recipient", "emailaddress");
/vemail.setHtmlTemplate/("portlets/html//email-confirm.vm/"); /
vemail.send/();
In that segment I put the oData-Objekt into the context, which I use to
get data from the database. Now I tried to reference that with
'$ctx.bestellung.id' (for example). But that didn't work (it stays
'$ctx.bestellung.id'). What did I do wrong?
The context object _is_ the Velocity context. So an object that you
put in with
ctx.put("bestellung", oData);
will be referenced as
$bestellung
on the template. There is no $ctx.
Please try $bestellung.getClass().getName() first, this should report
the class name of the object that you've put into the context.
Best regards
Henning
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]