I must be doing something really stupid with good old
C::V::Email::Template, but cannot figure out what. Why oh why isn't it
working?
I verified everything using the Chapter 11 example of the new Catalyst
book.
The email arrives alright, but its content has the register.tt2 template
embedded within the html wrapper.tt2 of my app. Some details:
Controller/Register.pm:
-----
$c->stash(
email => {
from => 'no-reply@somewhere.com',
to => "$username <$email>",
subject => 'Registration request',
template => 'mail/register.tt2',
content_type => 'text/plain',
},
);
$c->forward( $c->view('Email::Template') );
-----
View/Email/Template.pm
-----
package MyApp::View::Email::Template;
use strict;
use warnings;
use base 'Catalyst::View::Email::Template';
---
MyApp.pm:
-----
#-- View::Email::Template
__PACKAGE__->config(
'View::Email::Template' => {
stash_key => 'email',
template_prefix => '',
default => {
content_type => 'text/plain',
charset => 'utf-8',
},
sender => {
mailer => 'SMTP',
mailer_args => {
Host => 'mail.somewhere.com',
},
},
}
);
I must be doing something silly, but what?
--
Kiffin Gish <kiffin.gish@planet.nl>
Gouda, The Netherlands
_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
C::V::Email::Template, but cannot figure out what. Why oh why isn't it
working?
I verified everything using the Chapter 11 example of the new Catalyst
book.
The email arrives alright, but its content has the register.tt2 template
embedded within the html wrapper.tt2 of my app. Some details:
Controller/Register.pm:
-----
$c->stash(
email => {
from => 'no-reply@somewhere.com',
to => "$username <$email>",
subject => 'Registration request',
template => 'mail/register.tt2',
content_type => 'text/plain',
},
);
$c->forward( $c->view('Email::Template') );
-----
View/Email/Template.pm
-----
package MyApp::View::Email::Template;
use strict;
use warnings;
use base 'Catalyst::View::Email::Template';
---
MyApp.pm:
-----
#-- View::Email::Template
__PACKAGE__->config(
'View::Email::Template' => {
stash_key => 'email',
template_prefix => '',
default => {
content_type => 'text/plain',
charset => 'utf-8',
},
sender => {
mailer => 'SMTP',
mailer_args => {
Host => 'mail.somewhere.com',
},
},
}
);
I must be doing something silly, but what?
--
Kiffin Gish <kiffin.gish@planet.nl>
Gouda, The Netherlands
_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev