[Catalyst-dev] Re: RFC: Catalyst::View::Email and
Catalyst::View::TemplateEmail
J. Shirley
jshirley at gmail.com
Sat May 12 20:05:31 GMT 2007
Well, I said a few weeks, and I guess I meant 2 months.
But... a developer-ready-to-hack version 0.01 is out:
http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-View-Email
I have a tarball up if anybody wants it:
http://staff.toeat.com/~jshirley/Catalyst-View-Email-0.01.tar.gz
And, some example syntax:
sub test_action : Path('') {
my ( $self, $c ) = @_;
$c->stash->{email} = {
to => 'jshirley at toeat.com',
from => 'no-reply at toeat.com',
subject => 'Just a test',
content_type => 'multipart/alternative',
templates => [
qw{text_plain/test.tt},
qw{text_html/test.tt}
]
};
$c->forward('View::Email::Template');
if ( scalar( @{ $c->error } ) ) {
$c->log->_dump($c->error);
$c->error(0);
$c->res->body('Email was not sent, there was an error!');
} else {
$c->res->body('Email was sent ok.');
}
}
Hope you all have fun poking at it :) Sorry it took so long as well.
I really wanted to have this out about 3-4 weeks earlier.
--
J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com
On 3/26/07, Jason Kohles <email at jasonkohles.com> wrote:
> On Mar 26, 2007, at 11:17 AM, J. Shirley wrote:
>
> > On 3/23/07, A. Pagaltzis <pagaltzis at gmx.de> wrote:
> >> * Jonathan Rockway <jon at jrock.us> [2007-03-23 06:30]:
> >> > What's wrong with just C::V::Email? Are people realistically
> >> > going to use anything else?
> >>
> >> That's fine if the module is template engine agnostic. If not
> >> (but it should be), then the template engine should be included
> >> in the name (à la C::V::Email::TT).
> >>
> >
> > I agree with Aristotle, and I think C::V::Email::(TT|Mason) works
> > better. If no engine is specified, it will simply look at stash keys
> > for the content. I can't imagine why someone would have a Catalyst
> > app without some templating engine in place, but... there are stranger
> > things out there.
> >
>
> I have a Catalyst app without a templating engine. It doesn't serve
> any dynamic HTML pages at all, only a couple of static pages, some
> other assorted static files (.css, .png, .js, etc...) and a huge
> amount of dynamic JSON data.
>
> --
> Jason Kohles
> email at jasonkohles.com
> http://www.jasonkohles.com/
> "A witty saying proves nothing." -- Voltaire
>
>
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst-dev
>
More information about the Catalyst-dev
mailing list