[Catalyst-dev] RFC: Catalyst::View::Email and
Catalyst::View::TemplateEmail
Mario Minati
mario.minati at googlemail.com
Tue Mar 20 07:28:39 GMT 2007
Am Montag 19 März 2007 23:48 schrieb J. Shirley:
> 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.
>
> It's been my view for quite some time to do this via a View component, as
> Email to me is really just a view. It just isn't the end point view. I
> have working code that I can modify to make CPANable without too much
> effort. Right now it interacts directly with TT, but I'd like to separate
> that behavior out.
>
> Here's how I envision it (based on how my current code functions) --
>
> The config:
> MyApp->config('View::Email' => {
> stash_key => 'mail',
> default_types => [ qw(text/plain text/html) ],
> template_root => 'mail', # root/mail
> });
>
> In a controller, you populate:
>
> $c->stash->{mail} = {
> template => 'registration',
> types => [ qw(text/plain text/html) ],
> };
>
> Then the templates on disk would expected to be:
>
> root/mail/registration/textplain.tt
> root/mail/registration/texthtml.tt
>
> And finally, forward:
> $c->forward('View::Email');
>
> Emails away. Alternative syntax is: $c->forward('View::Email', [
> $mail_hash ]);
>
> Thoughts? I think this would be a good module to get out the door, get
> standardized and get a cookbook entry on.
>
How can I tell the user the the mail has been send successfully?
1. mailing error?
2. howto provide a normal view to the e.g. webapplication or xmlrpc?
Greets,
Mario Minati
More information about the Catalyst-dev
mailing list