[Catalyst] C::V::Email and Email::Sender 0.120002 -> 1.300003

Anthony Gladdish anthony.gladdish at newcastle.ac.uk
Mon Feb 11 14:44:16 GMT 2013


Hi,

Having problems when upgrading from Email::Sender 0.120002  -> 1.300003. 

While v1.300003  compiles and "make test" passes, it appears to be no longer working with Catalyst::View::Email ( v0.31 + v0.32 ):

# 1. Catalyst app config:

View::Email::Template:
    stash_key: 'email'
    template_prefix: 'email'
    default:
        content_type: 'text/plain'
        charset: 'utf-8'
        view: 'TT'
    sender:
        mailer: Test


# 2. some action that sends the email:

$c->stash->{email} = {
        to	        =>  'blah',
        from     	=> 'blah',
        subject     => 'blah',
        template    => 'blah.tt2',
    };        
    $c->forward( $c->view('Email::Template') );
    if ( scalar( @{ $c->error } ) ) {
        $c->error('blah');
        $c->detach('/end');
    }


# 3. Test:

use Test::More;
use Email::Sender::Simple;

BEGIN {
	$ENV{EMAIL_SENDER_TRANSPORT} = 'Test';
}

# some button click that calls action above that sends email <- test failing here.

my @emails = Email::Sender::Simple->default_transport->deliveries;


# Error:

Caught exception in MyApp::View::Email::Template->process "Attribute (_mailer_obj) does not pass the type constraint because: Validation failed for 'Email::Sender::Transport' with value Email::Sender::Transport::Test=HASH(0x2b875fe017e0) at accessor Catalyst::View::Email::_mailer_obj (defined at ~/ locallib/lib/perl5/Catalyst/View/Email.pm line 21) line 18.

Anyone else getting these sorts of errors?
This test script passed before, until upgrading. Is this something you can help with?

Regards,
Anthony



More information about the Catalyst mailing list