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: 88746
Status: rejected
Priority: 0/
Queue: Catalyst-View-Email

People
Owner: Nobody in particular
Requestors: mitch [...] ptaff.ca
Cc:
AdminCc:

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



Subject: Template doesn't render with version 0.33
Date: Tue, 17 Sep 2013 13:57:19 -0400
To: bug-Catalyst-View-Email [...] rt.cpan.org
From: Stefan Michalowski <mitch [...] ptaff.ca>
Hello, I upgraded to version of Catalyst::View::Email and it broke my application. The application would send empty emails because somehow Catalyst::View::Email stopped working. The previous version (0.31) worked. I compared both version of Catalyst::View:Email::Template and saw the following difference (around line 294): The following in 0.31: push @parts, $self->generate_part( $c, { template => $c->stash->{$stash_key}->{template}, } ); } was replaced with the following in 0.33: 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, $part_args ); When I moved the 0.31 version into the 0.33 version and restarted my application, it worked as previously. Best Regards, -- Stefan Michalowski, M. Sc. mitch@ptaff.ca
Download signature.asc
application/pgp-signature 261b

Message body not shown because it is not plain text.

This is caused by the bugfix for https://rt.cpan.org/Public/Bug/Display.html?id=66495. As you haven't showed us your usage of the module my best guess is that you don't set the content_type.
Subject: Re: [rt.cpan.org #88746] Template doesn't render with version 0.33
Date: Wed, 18 Sep 2013 09:36:04 -0400
To: bug-Catalyst-View-Email [...] rt.cpan.org
From: Stefan Michalowski <mitch [...] ptaff.ca>
On 13-09-17 05:28 PM, Alexander Hartmaier via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=88746 > > > This is caused by the bugfix for https://rt.cpan.org/Public/Bug/Display.html?id=66495. > > As you haven't showed us your usage of the module my best guess is that you don't set the content_type. >
I do set the content_type in my use case, here is the relevant part of my application: $c->stash->{email} = { to => join(',',@EMAILS), from => 'no-reply@example.com', subject => 'Rapport: ' . $subject, template => 'email_reports.tt', content_type => 'multipart/alternative' }; $c->forward( $c->view('Email::Template') ); I also set some variables in the stash that are used by the template before excecuting this code. Best Regards, -- Stefan Michalowski, M. Sc. mitch@ptaff.ca
Download signature.asc
application/pgp-signature 261b

Message body not shown because it is not plain text.

multipart/alternative would be the correct content-type if your mail has multiple parts, for example a text/html and a text/plain one. I just saw that the example in the docs incorrectly uses multipart/alternative, a doc patch is highly welcome! Depending if your template renders to text/plain or text/html you have to the set the correct one.
Subject: Re: [rt.cpan.org #88746] Template doesn't render with version 0.33
Date: Wed, 18 Sep 2013 12:01:51 -0400
To: bug-Catalyst-View-Email [...] rt.cpan.org
From: Stefan Michalowski <mitch [...] ptaff.ca>
On 13-09-18 11:51 AM, Alexander Hartmaier via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=88746 > > > multipart/alternative would be the correct content-type if your mail has multiple parts, for example a text/html and a text/plain one. > I just saw that the example in the docs incorrectly uses multipart/alternative, a doc patch is highly welcome! > Depending if your template renders to text/plain or text/html you have to the set the correct one. >
Ah, that would explain the problem. I did find multipart/alternative a weird choice for a text email. I changed my content_type to text/plain and the 0.33 version works. Thanks. Best Regards, -- Stefan Michalowski, M. Sc. mitch@ptaff.ca
Download signature.asc
application/pgp-signature 261b

Message body not shown because it is not plain text.

Great!