repository = http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-View-Email/0.10/
+[MetaRecommends]
+Catalyst::View::TT = 0.31
+Catalyst::View::Mason = 0.18
+MIME::Base64 = 3.08
+Authen::SASL = 2.13
+
[Prereq]
Catalyst = 5.7
Email::MIME = 1.859
Email::MIME::Creator = 1.455
Email::Send::Test = 2.198
-Catalyst::View::TT = 0.31
-Catalyst::View::Mason = 0.18
-MIME::Base64 = 3.08
-Authen::SASL = 2.13
use Moose;
use Carp;
use Scalar::Util qw/ blessed /;
-use Data::Dumper;
extends 'Catalyst::View::Email';
our $VERSION = '0.17';
%{$c->stash},
}
);
- warn "Email output: $output";
if ( ref $output ) {
croak $output->can('as_string') ? $output->as_string : $output;
}
return $self->$orig( $c, @args )
unless $c->stash->{$stash_key}->{template}
or $c->stash->{$stash_key}->{templates};
- warn "Stash: " . $stash_key;
# in case of the simple api only one
my @parts = ();
$c->stash->{$stash_key}->{parts} ||= [];
push @{ $c->stash->{$stash_key}->{parts} }, @parts;
- warn "Stash: " . Dumper $c->stash;
return $self->$orig($c);
};
use_ok('Catalyst::Test', 'TestApp');
TestApp->config->{default_view} = 'Mason';
-use Data::Dumper;
my $response;
my $time = time;
ok( ( $response = request("/mason_email?time=$time"))->is_success,
'request ok' );
like( $response->content, qr/Mason Email Ok/, 'controller says ok' );
my @emails = Email::Sender::Simple->default_transport->deliveries;
-#warn "Email: " . Dumper @emails;
cmp_ok(@emails, '==', 1, 'got emails');
isa_ok( $emails[0]->{'email'}, 'Email::Abstract', 'email is ok' );
my @parts = $emails[0]->{'email'}[0]->parts;
cmp_ok(@parts, '==', 2, 'got parts');
-#warn "Parts: " . Dumper @parts;
is($parts[0]->content_type, 'text/plain', 'text/plain ok');
like($parts[0]->body, qr/test-email\@example.com on $time/, 'got content back');
is($parts[1]->content_type, 'text/html', 'text/html ok');