2 Catalyst::Plugin::Email - Send emails with Catalyst
7 __PACKAGE__->config->{email} = [qw/SMTP smtp.oook.de/];
11 From => 'sri@oook.de',
19 Send emails with Catalyst and Email::Send and Email::MIME::Creator.
22 A common practice is to handle emails using the same template language
23 used for HTML pages. This can be accomplished by pairing this plugin
24 with Catalyst::Plugin::SubRequest.
26 Here is a short example of rendering an email from a Template Toolkit
27 source file. The call to $c->subreq makes an internal call to the
28 render_email method just like an external call from a browser. The
29 request will pass through the end method to be processed by your View
32 sub send_email : Local {
33 my ( $self, $c ) = @_;
38 Subject => 'A TT Email',
40 body => $c->subreq( '/render_email' ),
42 # redirect or display a message
45 sub render_email : Local {
46 my ( $self, $c ) = @_;
49 names => [ qw/andyg sri mst/ ],
50 template => 'email.tt',
56 [%- FOREACH name IN names -%]
77 Catalyst, Catalyst::Plugin::SubRequest, Email::Send,
81 Sebastian Riedel, "sri@cpan.org"
84 This program is free software, you can redistribute it and/or modify it
85 under the same terms as Perl itself.