FAQ
Perhaps fire up your app from the cron job using
Catalyst::Engine::Embeddable?

--

Jon Schutz
http://notes.jschutz.net
On 10/04/11 22:40, Charlie Garrison wrote:
Good evening,

First, I may not be approaching this the right way at all. So I'm
happy to take any suggestions for a better way to do what I need.

I've got a daily task (cron job currently) which sends emails to
users. I want to use existing TT templates to generate the email
content. I'm using Mail::Builder::Simple for the message creation &
sending.

All the simple tests are working fine, until I want to use the
existing template setup that I've been using to send email from within
Catalyst. Specifically, the wrapper template (with header, footer,
etc) makes fairly extensive use of c.uri_for and c.uri_for_action. And
of course the Catalyst context is not available from the cron job (at
least no way that I could find).

One option is to move all the logic to a controller action and just
have the cron job make an http request. That doesn't seem like the
right approach though.

Does anyone have suggestions on how I can use my existing template
structure and still be able to use `c` from a cron job? Or should I
use a completely different approach?

Thanks,
Charlie

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 11 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 10, '11 at 1:10p
activeApr 12, '11 at 5:53a
posts11
users5
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase