[Catalyst-dev] C::V::Email::Template email contents includes wrapper ...

Kiffin Gish kiffin.gish at planet.nl
Mon Jan 11 15:39:24 GMT 2010


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 at 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 at planet.nl>
Gouda, The Netherlands




More information about the Catalyst-dev mailing list