Thiago - thanks for the pointer, I ended up pre-rendering the content of
the emails in the web app and storing it, and then performing the actual
sending using the pre-rendered content in the queue.

 It would have been cool if there was something that allowed generating
links and/or rendering tapestry templates in a non-web context (e.g. Grails
has a GSP page renderer
http://mrhaki.blogspot.com/2012/03/grails-goodness-render-gsp-views-and.html) .
I understand that much of what tapestry does depends on the servlet
environment being there, but still it's obviously possible to do and it
would have been nice not to have to use freemarker for the mail templates)

Cheers,

Alex K
On Fri, Sep 28, 2012 at 2:59 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 28 Sep 2012 15:41:50 -0300, Alex Kotchnev <akoch...@gmail.com>
> wrote:
>
>  In my application, I send html emails which contain links to the
>> application. I use the pageRenderLinkSource.**createPageRenderLink to
>> generate the URLs from within the application.
>>
>> So far, so good. The trouble begins when I tried to make the email sending
>> asynchronous : that is, the application just queues them up, and sometime
>> later a message listener picks up the email requests from the queue, and
>> sends the actual emails. The problem is that by the time the emails are
>> being generated, there is no current request associated with the current
>> thread; hence, the link generation fails miserably (see stack trace, the
>> exception is thrown when I call pageRenderLinkSource.**
>> createPageRenderLink).
>>
>> Any thoughts on how I could get around this ? Is there some other way that
>> I could generate a link that doesn't rely on requestglobals ?
>>
>
> I know it's not an answer, but you could create the Link and store it
> somewhere before queuing the e-mail. Of course, this will work just if you
> already know which pages to link before merging the template.
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org<users-unsubscr...@tapestry.apache.org>
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to