[Catalyst-dev] RFC: Catalyst::View::Email and
Catalyst::View::TemplateEmail
Jonathan Rockway
jon at jrock.us
Tue Mar 20 14:15:24 GMT 2007
On Tuesday 20 March 2007 08:22, Bogdan Lucaciu wrote:
> On Tuesday 20 March 2007 00:48, J. Shirley wrote:
> > Some discussion with ash in #catalyst revealed that there is a need for a
> > more modern, up to date, best practice, shiny method for emailing from
> > within a Catalyst app.
>
> you'll need to consider
> - attachements (from files, filehandles, scalarrefs)
> - html mail
> - automatically attaching all images in the html mail
>
> I -hate- HTML mail , but unfortunately clients don't.
My advice is to allow a directory structure like:
mail/template.tt
mail/text-html/template.tt
When you say stash->{template} is template.tt, a multipart/alternative
messagse is created with template.tt as the plain text version and
text-html/template.tt as the HTML version. If you have other mime-types,
those could be rendered and auto-added to the MIME structure. Convenient.
I would use [% INCLUDE %] to avoid duplicating text between the two versions.
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
More information about the Catalyst-dev
mailing list