Forum: Ruby on Rails Mailer Strategy

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E37ca8b3eee534fa6781f7ba13743afb?d=identicon&s=25 ryan.wood (Guest)
on 2005-11-21 00:16
(Received via mailing list)
Hi all. First let me say thanks for being such a patient and helpful
bunch. I'm a .NET developer by day, but since I discovered Rails I'm
having a tough time waking up and going to work (as I stay up so late
working on Rails projects ; ) ). You all are a large part of why I
enjoys Rails so much. So thanks!

I'm running into a bit of a snag with a Rails app I'm building. I need
to have a nightly (cron) job that will send off emails to  customers
with an attached CSV file. I'm struggling with how to implement it.

Since it's a Rails app, I started using ActionMailer and make it a
page in the app, but it could potentially timeout as the app grows.
I've also thought about a single .rb file that I could call from a
cron job that would process and send the mail. Unfortunately, I don't
have much Ruby experience outside Rails and wasn't sure how to best
pull that off. I'll still like to utilize the application models and
views. Any guidance would be greatly appreciated.

Thanks!

--Ryan
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 tmornini (Guest)
on 2005-11-21 01:00
(Received via mailing list)
script/runner let's you run Rails apps without the browser environment.

It's just what you need.

--
-- Tom Mornini
E37ca8b3eee534fa6781f7ba13743afb?d=identicon&s=25 ryan.wood (Guest)
on 2005-11-21 01:33
(Received via mailing list)
Thanks for the response. I how to call a model from runner, but how
would you render a view? I'm currently creating the attached file in a
view for a manually run report. I need to render the same view, but
attach it to an email. Can that be done through runner?

--Ryan
This topic is locked and can not be replied to.