On 12 April 2011 00:50, Charlie Garrison wrote:

Good morning,

On 11/04/11 at 6:58 PM +0300, Octavian Rasnita wrote:

The TT templates used by the Catalyst app might contain many things
like c.user, c.uri_for_action, may display images, may depend on other
templates which are loaded automaticly when those templates are
specified in the app config file. So there is no sane way of using
those wrapper templates for sending email from a cron job.
That was the conclusion I was reaching; I wanted feedback from others
before I tried to make my own garden path.
Put the logic in a model class that reads a config shared with but
independent from your controller so you can run it outside of Catalyst.
This article outlines how to do this
If you need any web transaction details (c.user etc.) capture them at
request time and put them in an item in a queue (using ActiveMQ or similar).
Then in your cron script step through the queue entries, unpack the details
and do the template merge using TT2 before sending using Mail::Sender or
Email::Stuff or whatever.
You don't really need the Catalyst controller framework up and running to do

Regards, Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110412/c2f77931/attachment.htm

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 10 of 11 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 10, '11 at 1:10p
activeApr 12, '11 at 5:53a



site design / logo © 2022 Grokbase