[Catalyst] Catalyst::Plugin::Email, TT, html config problem

Nick Anderson nick at webcraftcs.com
Tue Dec 18 20:50:18 GMT 2012


Hi Tadhg,

Shouldn't it be just:

content_type =3D> 'text/html' ?


Nick

On 18/12/12 20:36, Tadhg wrote:
>
> Hi,
>
> I can't get SMTP email messages to use HTML encoding using =

> Catalyst::Plugin::Email and TT. The mails are being generated and =

> contain the html tags from the correct template and correct stashed =

> data, but it's being displayed as plain text in the received email.
>
> It's a simple logging application, allowing various distributed =

> scripts to log messages centrally. When an error message is logged I =

> want to generate a mail to the appropriate admin.
>
> I'm assuming the "content_type_set =3D> 'text/html'" line is wrong but =

> can't find what it should be.
>
>
> Any help would be appriciated, code extracts etc. are below.
>
>
>
> *App Config:*
>
> use Catalyst qw/
>
>     -Debug
>
>     ConfigLoader
>
>     Static::Simple
>
>     AutoCRUD
>
>     Email
>
>     StackTrace
>
> /;
>
> *Mail Code:*
>
> ...
>
> $c->stash(add_log_line =3D> $add_log_line,
>
> template =3D> 'log/add_general.tt <http://add_general.tt>');
>
> $c->forward($c->view('HTML'));
>
> $c->email(
>
> header =3D> [
>
> From =3D> 'bob at bob.com <mailto:bob at bob.com>',
>
> To =3D> 'fred at bob.com <mailto:fred at bob.com>',
>
> Subject =3D> 'An error has been reported'
>
> ],
>
> body =3D> $c->view('HTML')->render($c,'log/email_msg.tt =

> <http://email_msg.tt>'),
>
> content_type_set =3D> 'text/html'
>
> );
>
> *Received Mail:*
>
> <!DOCTYPE>
>
> <body>
>
> <table>
>
> <tr>
>
> <th>msg_type</th>
>
> <th>message</th>
>
> <th>source_hostname</th>
>
> ...
>
> Thanks,
>
> Tadhg Daley
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121218/ef493=
c0d/attachment.htm


More information about the Catalyst mailing list