$c->stash->{time} = $c->req->params->{time} || time;
$c->stash->{email} = {
+ to => 'test-email@example.com',
+ from => 'no-reply@example.com',
+ subject => 'Just a test',
+ content_type => 'multipart/alternative',
+ templates => [
+ {
+ template => 'text_plain/test.tt',
+ content_type => 'text/plain',
+ },
+ {
+ view => 'TT',
+ template => 'text_html/test.tt',
+ content_type => 'text/html',
+ },
+ ],
+ };
+
+ $c->forward('TestApp::View::Email::Template');
+
+ if ( scalar( @{ $c->error } ) ) {
+ $c->res->status(500);
+ $c->res->body('Template Email Failed');
+ } else {
+ $c->res->body('Template Email Ok');
+ }
+}
+
+sub template_email_app_config : Global('template_email_app_config') {
+ my ($self, $c, @args) = @_;
+
+ $c->stash->{time} = $c->req->params->{time} || time;
+
+ $c->stash->{template_email} = {
to => 'test-email@example.com',
from => 'no-reply@example.com',
subject => 'Just a test',
- content_type => 'multipart/alternative',
templates => [
- qw{text_plain/test.tt},
- qw{text_html/test.tt}
- ]
+ {
+ template => 'text_plain/test.tt',
+ content_type => 'text/plain',
+ },
+ {
+ view => 'TT',
+ template => 'text_html/test.tt',
+ content_type => 'text/html',
+ },
+ ],
};
- $c->forward('TestApp::View::Email::Template');
+ $c->forward('TestApp::View::Email::Template::AppConfig');
if ( scalar( @{ $c->error } ) ) {
$c->res->status(500);
}
}
+sub mason_email : Global('mason_email') {
+ my ($self, $c, @args) = @_;
+
+ $c->stash->{time} = $c->req->params->{time} || time;
+
+ $c->stash->{email} = {
+ to => 'test-email@example.com',
+ from => 'no-reply@example.com',
+ subject => 'Just a test',
+ view => 'Mason',
+ templates => [
+ {
+ template => 'text_plain/test.m',
+ content_type => 'text/plain',
+ },
+ {
+ view => 'Mason',
+ template => 'text_html/test.m',
+ content_type => 'text/html',
+ },
+ ],
+ };
+
+ $c->forward('TestApp::View::Email::Template');
+
+ if ( scalar( @{ $c->error } ) ) {
+ $c->res->status(500);
+ $c->res->body('Mason Email Failed');
+ } else {
+ $c->res->body('Mason Email Ok');
+ }
+}
+
+
1;