<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.6058" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><B>From:</B> <A title=peter@dragonstaff.co.uk
href="mailto:peter@dragonstaff.co.uk">Peter Edwards</A> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV class=gmail_quote>On 12 April 2011 00:50, Charlie Garrison <SPAN
dir=ltr><<A
href="mailto:garrison@zeta.org.au">garrison@zeta.org.au</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Good
morning,<BR><BR>On 11/04/11 at 6:58 PM +0300, Octavian Rasnita <<A
href="mailto:orasnita@gmail.com" target=_blank>orasnita@gmail.com</A>>
wrote:<BR><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">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><FONT face=Arial size=2></FONT> </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><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>At the top of that article appears:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>"<STRONG>UPDATE</STRONG>: As of 2008, there is a
new module which avoids the "kludgy" solution mentioned below: <A
href="http://search.cpan.org/perldoc?Config::JFDI"><FONT
color=#bb0000>Config::JFDI</FONT></A>."</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>At a certain moment, Config::JFDI started to
support "</FONT>__path_to()".</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The problem is not the model only, but the
templates that use the Catalyst context in them.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>As it is not very recommended to access the
entire Catalyst context in a model, it should be not recommended to use the
context in the templates, because those templates won't be usable in external
applications without loading the entire Cat app, but because using the
Catalyst context in the templates is very handy, most of us probably prefer to
create separate templates for using them in external apps than to provide only
sane variables to all the templates.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Octavian</FONT></DIV>
<DIV><FONT face=Arial
size=2></FONT> </DIV></DIV></BLOCKQUOTE></BODY></HTML>