[Catalyst] Catalyst generating emails -- how to buffer large attachments?

Tomas Doran bobtfish at bobtfish.net
Wed Dec 21 11:34:59 GMT 2011


On 20 Dec 2011, at 21:20, will trillich wrote:
> Is there a (straightforward, hopefully :) way to buffer large  
> attachments when generating emails via a Catalyst View?

Yes, in the view code :_)

But you don't mean this, you mean 'in Catalyst::View::Email'

> If we could use a combination of Template-Toolkit and Email::Stuff  
> which handles buffering nicely (hand it a $FH instead of content,  
> swee-ee-eet) that would be grand. It doesn't look like Email::MIME  
> (which Catalyst::View::Email builds upon) doesn't seem to expect  
> anything other than $body_content.

Time to not be using Catalyst::View::EMail then :)

I'd recommend just sub-classing either your existing (or a new) TT  
view, and using around render => sub {... to do whatever you want with  
Email::Stuff, taking the document you've just rendered with TT, and  
the other attachments and doing the right thing.

Cheers
t0m





More information about the Catalyst mailing list