On 5/22/07, Evaldas Imbrasas <[EMAIL PROTECTED]> wrote:

Hello list,

I'm looking for best practices for sending email from the catalyst app
that would also work with command-line scripts (cronjobs, one-time
scripts, etc.).

In my current setup, Email model takes care of storing metadata in the
database for each sent email, and Email controller has a private
method which takes care of generating and sending actual emails. Is
this the right way to go, or would it make more sense to move the
email sending functionality to some utility module so it works equally
well for non-catalyst scripts as well? Or is it easy enough to
setup/prepare the catalyst context in the scripts so that I could use
the send_email method from the catalyst Email controller?

What is the most common email framework setup among catalyst users? I
think it would be useful to add a few possible examples for this to
Catalyst::Manual::Cookbook as well.

Thanks.
--
-----------------------------------------------------
Evaldas Imbrasas
http://www.imbrasas.com


Hi Evaldas,

I've recently been working on an Email view, which I hope will become the
recommended way to send Email from Catalyst.  It hitches into Email::Send,
and also ties into your Template view (which, sadly, only works with
View::TT at the moment but I'm hoping to get the other views supported soon)

I haven't posted it to CPAN yet, as I'm waiting to get some tests written up
for it, but you can download it from the Catalyst SVN repository at:
http://dev.catalystframework.org/repos/Catalyst/trunk/Catalyst-View-Email/

I also have a tarball at
http://staff.toeat.com/~jshirley/Catalyst-View-Email-0.01.tar.gz

I recommend you read through the pod for both Catalyst::View::Email and
Catalyst::View::Email::Template

And, as for sending out an email via the command line, there are many ways
to achieve this depending upon what your goal and full use case is.

Good luck, and happy hacking,
-J

--
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to