Re: Using tapestry tml as a mail template

2014-06-12 Thread Ilya Obshadko
On Wed, Jun 11, 2014 at 6:32 PM, Dmitry Gusev wrote: I agree with Ilya, > it may be easier to use some template engine for this. > > For example, we're using StringTemplate. > > The only issue when using external template engine is creating URLs to the > application, because you may be sending em

Re: Using tapestry tml as a mail template

2014-06-11 Thread Sanket Sharma
I use Velocity. Implemented a 'Template Service' to expose velocity engine to pages and components. Using Velocity's datasource resource loader to load templates from database. Here's an outline: public interface TemplateService { public String getMergedTemplate(String templateName, Map contex

Re: Using tapestry tml as a mail template

2014-06-11 Thread Thiago H de Paula Figueiredo
On Wed, 11 Jun 2014 13:06:34 -0300, Norman Franke wrote: Compared to using another tempting engine. One more thing to learn. This solution also works back to Tapestry 5.0, and works for any non-tapestry pages you may have just the same. I had just mentioned three different ways of using th

Re: Using tapestry tml as a mail template

2014-06-11 Thread Norman Franke
Compared to using another tempting engine. One more thing to learn. This solution also works back to Tapestry 5.0, and works for any non-tapestry pages you may have just the same. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jun 11, 2014, at 11:17 AM, Thiago H de Paula

Re: Using tapestry tml as a mail template

2014-06-11 Thread Thiago H de Paula Figueiredo
On Wed, 11 Jun 2014 11:14:38 -0300, Norman Franke wrote: Or even easer, use a web client library like jsoup to fetch the page from localhost, strip out what you don’t want, create any inline image attachments, and send. I'm not sure how using another library would be easier than using Tape

Re: Using tapestry tml as a mail template

2014-06-11 Thread Boris Horvat
Will start with FreeMarker and work our way down :) Thank you everyone with quick answers On Wed, Jun 11, 2014 at 4:32 PM, Dmitry Gusev wrote: > I agree with Ilya, > it may be easier to use some template engine for this. > > For example, we're using StringTemplate. > > The only issue when usin

Re: Using tapestry tml as a mail template

2014-06-11 Thread Dmitry Gusev
I agree with Ilya, it may be easier to use some template engine for this. For example, we're using StringTemplate. The only issue when using external template engine is creating URLs to the application, because you may be sending emails out of web request scope and LinkSourceImpl won't work with

Re: Using tapestry tml as a mail template

2014-06-11 Thread Norman Franke
Or even easer, use a web client library like jsoup to fetch the page from localhost, strip out what you don’t want, create any inline image attachments, and send. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jun 11, 2014, at 9:48 AM, Thiago H de Paula Figueiredo wrot

Re: Using tapestry tml as a mail template

2014-06-11 Thread Boris Horvat
Will try it like that. Thanks On Wed, Jun 11, 2014 at 3:46 PM, Ilya Obshadko wrote: > I'd better use (and in fact I do use) some other template engine for > emails. Would be much easier for everything (including plain-text emails, > for example). My choice is FreeMarker, but Velocity is equally

Re: Using tapestry tml as a mail template

2014-06-11 Thread Thiago H de Paula Figueiredo
On Wed, 11 Jun 2014 10:20:29 -0300, Boris Horvat wrote: Hi everyone, Hi! I was wondering would it be possible to create a page (i.e. tml and java code) and then sending that data to the database on certain event. basically using tapestry as a template mechanism Yep! See tapestry-offline

Re: Using tapestry tml as a mail template

2014-06-11 Thread Ilya Obshadko
I'd better use (and in fact I do use) some other template engine for emails. Would be much easier for everything (including plain-text emails, for example). My choice is FreeMarker, but Velocity is equally good. You can easily implement a service that encapsulates all template operations. You may

Using tapestry tml as a mail template

2014-06-11 Thread Boris Horvat
Hi everyone, I was wondering would it be possible to create a page (i.e. tml and java code) and then sending that data to the database on certain event. basically using tapestry as a template mechanism Can I serve row output of the page somehow? In other words to force tapestry to compile html fo