Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Catalyst-View-Email CPAN distribution.

Report information
The Basics
Id: 66495
Status: resolved
Priority: 0/
Queue: Catalyst-View-Email

People
Owner: Nobody in particular
Requestors: terencemo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.31
Fixed in: (no value)



Subject: Plaintext mail using C:V:Email::Template
Download (untitled) / with headers
text/plain 909b
When I set the content type to text/plain and forward to Email::Template view, I get a text/html mail. Controller code: $c->stash->{email} = { to => 'jshirley@gmail.com', cc => 'abraxxa@cpan.org', from => 'no-reply@foobar.com', subject => 'I am a Catalyst generated email', template => 'test.tt', content_type => 'text/plain' }; $c->forward( $c->view('Email::Template') ); I'm able to replicate this by modifying sub template_email in http://cpansearch.perl.org/src/DHOSS/Catalyst-View-Email- 0.31/t/lib/TestApp/Controller/Root.pm in the testapp bundled with this dist. But when I set stash->{email}->{templates} to a single hash array with the template name and content_type, it works: $c->stash->{email}->{templates} = [ { template => 'test.tt', content_type => 'text/plain' } ];
Attached patch takes care of the content_type..
Subject: C-V-Email-Template.patch
--- /usr/share/perl5/Catalyst/View/Email/Template.pm.bk 2011-03-09 16:14:33.000000000 +0530 +++ /usr/share/perl5/Catalyst/View/Email/Template.pm 2011-03-09 16:18:53.000000000 +0530 @@ -275,9 +275,12 @@ # single part api elsif ( $c->stash->{$stash_key}->{template} ) { + my $part_args = { template => $c->stash->{$stash_key}->{template} }; + if (my $ctype = $c->stash->{$stash_key}->{content_type}) { + $part_args->{content_type} = $ctype; + } push @parts, - $self->generate_part( $c, - { template => $c->stash->{$stash_key}->{template}, } ); + $self->generate_part( $c, $part_args ); } delete $c->stash->{$stash_key}->{body};
Download (untitled) / with headers
text/plain 136b
On Wed Mar 09 05:59:55 2011, TERENCEMO wrote: Show quoted text
> Attached patch takes care of the content_type..
Applied (with additional test) in 0.32.
Patched and merged to master.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.