<br><div class="gmail_quote">On 12 April 2011 00:50, Charlie Garrison <span dir="ltr">&lt;<a href="mailto:garrison@zeta.org.au">garrison@zeta.org.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Good morning,<br>
<br>
On 11/04/11 at 6:58 PM +0300, Octavian Rasnita &lt;<a href="mailto:orasnita@gmail.com" target="_blank">orasnita@gmail.com</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The TT templates used by the Catalyst app might contain many things<br>
like c.user, c.uri_for_action, may display images, may depend on other<br>
templates which are loaded automaticly when those templates are<br>
specified in the app config file. So there is no sane way of using<br>
those wrapper templates for sending email from a cron job.<br>
</blockquote>
<br>
That was the conclusion I was reaching; I wanted feedback from others before I tried to make my own garden path.<br></blockquote><div> </div><div>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.</div>
<div>This article outlines how to do this <a href="http://www.catalystframework.org/calendar/2007/14">http://www.catalystframework.org/calendar/2007/14</a></div><div>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).</div>
<div>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.</div><div>You don&#39;t really need the Catalyst controller framework up and running to do that.</div>
<div><br></div><div>Regards, Peter</div><div><br></div><div><br></div></div>