Hi Tim,

if you're are using Wonder, it seems obvious to me to use WOComponent as a 
template engine.

1. define your component as you do with normal wocomponents

2. Instantiate like this:

YourMailComponent mailComponent = (YourMailComponent) 
ERMailUtils.instantiatePage(your.app. YourMailComponent.class.getName(), null);
mailComponent.setBinding1(binding1Value);
mailComponent.setBinding2(binding2Value);
String htmlOfYourMailComponent = 
mailComponent.generateResponse().contentString()

C.U.CW
--
The three great virtues of a programmer are Laziness, Impatience and Hubris. 
(Randal Schwartz)

> On 09.10.2015, at 17:39, T Worman <li...@thetimmy.com> wrote:
> 
> Reaching out to the list to see what my fellow abandonees prefer for 
> templating. My needs are pretty simple - I’m just looking to use templates to 
> compose emails. I have far too many email methods where the bodies of the 
> emails are completely composed in code and I’d really like to move that out 
> to some template engine.
> 
> So, the question is, what template engine do you prefer for this kind of 
> work? Obviously, we’ve already got velocity producing our EO .java files - 
> and I’m sure that’s workable. Any strong preferences out there?
> 
> I really like StringTemplate (http://www.stringtemplate.org). A feature I 
> liked was the ability to pass an object to the template and the template 
> could contain “keypaths” to attributes of the object - very much like we 
> expect from the WO template engine. However, it would not work with accessors 
> that do not use the get* convention - which I haven’t. I could convert but 
> not sure it is worth it.
> 
> Tim
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/cw%40i4innovation.de
> 
> This email sent to c...@i4innovation.de

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to