subject => qq{Your Subject Here},
body => qq{Body Body Body}
};
- $c->forward('View::Email');
+ $c->forward( $c->view('Email' ) );
}
Alternatively, you can use a more raw interface, and specify the headers as
If the email fails to send, the view will die (throw an exception). After
your forward to the view, it is a good idea to check for errors:
- $c->forward('View::Email');
+ $c->forward( $c->view('Email' ) );
if ( scalar( @{ $c->error } ) ) {
$c->error(0); # Reset the error condition if you need to
$c->res->body('Oh noes!');
subject => 'I am a Catalyst generated email',
template => 'test.tt',
};
- $c->forward('View::Email::Template');
+ $c->forward( $c->view('Email::Template' ) );
Alternatively if you want more control over your templates you can use the following idiom
to override the defaults: