[Catalyst] Suggestions for sending email from cron
orasnita at gmail.com
Tue Apr 12 05:53:03 GMT 2011
From: Peter Edwards =
On 12 April 2011 00:50, Charlie Garrison <garrison at zeta.org.au> wrote:
On 11/04/11 at 6:58 PM +0300, Octavian Rasnita <orasnita at gmail.com> wro=
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 b=
efore I tried to make my own garden path.
Put the logic in a model class that reads a config shared with but indepe=
ndent from your controller so you can run it outside of Catalyst.
This article outlines how to do this http://www.catalystframework.org/cal=
At the top of that article appears:
"UPDATE: As of 2008, there is a new module which avoids the "kludgy" solu=
tion mentioned below: Config::JFDI."
At a certain moment, Config::JFDI started to support "__path_to()".
The problem is not the model only, but the templates that use the Catalys=
t context in them.
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, be=
cause those templates won't be usable in external applications without load=
ing the entire Cat app, but because using the Catalyst context in the templ=
ates 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=
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Catalyst