[Catalyst-dev] Catalyst plugin

Matt S Trout dbix-class at trout.me.uk
Tue Sep 30 15:23:55 BST 2008


On Tue, Sep 30, 2008 at 01:44:49PM +0300, Octavian Rasnita wrote:
> Hi,
> 
> Thank you all for recommending to create a view. I know about C::V::Email but I always prefered to use C::P::Email because it was more simple.

C::V::Email is definitely a better approach; email sending really shouldn't
need to be a plugin. Also note that using a plugin means you can only have
one $c->email per app which means you can't re-use code as easily, whereas
you can have several views and different controllers use different ones.

> Anyway, probably partly I didn't like C::V::Email because I needed to create the email message manually if it contains attachments, images...
> 
> I will try to create a view. I hope I will succeed.

You should see about patching Catalyst::View::Email instead, I think.

>From my memory C::V::Email::Template already handles creating the basic mail.

Maybe by porting the mail sending code to either Mail::Builder or Email::Stuff
you could achieve something where you can send attachments in the stash, and
maybe have a syntax to get the mime addresses for images - something like
adding $c->stash->{image_link} as a sub that resolves that so then in your
template you can do [% image_link('foo.jpg') %} for
$c->stash->{attachments}{foo.jpg} or something like that?

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst-dev mailing list