[Catalyst] Suggestions for sending email from cron job using 'Catalyst' templates?

Jon Schutz jon+catalyst at youramigo.com
Mon Apr 11 11:50:21 GMT 2011



On 04/11/2011 06:30 PM, Charlie Garrison wrote:
> Good evening,
>
> On 11/04/11 at 10:34 AM +0930, Jon Schutz <jon+catalyst at youramigo.com>
> wrote:
>
>> Perhaps fire up your app from the cron job using
>> Catalyst::Engine::Embeddable?
>
> Thanks, didn't know about that one; I'll have a look.
>
> Hmm, the documentation is a bit sparse; I can't see how to get $c (or
> $app). I can't see anything in the test files either which show how to
> get the app object. Do you have an example you could share?
>
> Or should I just start the embeddable instance and then do a
> handle_request to process the email sending?
>

That was my thought.  Usage is essentially...

use strict;
use warnings;
use HTTP::Request;

BEGIN {
$ENV{CATALYST_ENGINE} = 'Embeddable';
}

require MyApp;
my $response;
MyApp->handle_request(HTTP::Request->new('GET',
'http://localhost/send/email'), \$response);


-- 

Jon Schutz
http://notes.jschutz.net/



More information about the Catalyst mailing list