[Catalyst-dev] RFC: Catalyst::View::Email and Catalyst::View::TemplateEmail

J. Shirley jshirley at gmail.com
Tue Mar 20 15:00:35 GMT 2007


On 3/20/07, Jonathan Rockway <jon at jrock.us> wrote:
> 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;
>
>

Good point and idea, mail/$mime-type/$template.tt -- I'll also put in
an option to include everything by doing checks if the template exist.

-- 
J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com



More information about the Catalyst-dev mailing list