Hey all, I realize this probably is beyond the scope of rails, but I was wondering if anyone was using ruby to run a process that sends batch emails daily. I have a course registration website that needs to send reminder emails the day before a class is scheduled to begin. The only way I can think of this is to invoke a thread on startup that wakes up every day and sends emails accordingly. Another issue is that I''ve heard ActionMail isn''t very good with sending batch emails. I suppose I could go back to writing a java program to do this, but I was wondering what others have done in a similar position. Thanks all, have a great day, Jin _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Jin, Write an action that will do your daily email processing, and make a cron job with wget that will request it once a day. - Jamie On Fri, 2005-04-11 at 11:18 -0800, Jin Lee wrote:> Hey all, > > I realize this probably is beyond the scope of rails, but I was > wondering if anyone was using ruby to run a process that sends batch > emails daily. I have a course registration website that needs to send > reminder emails the day before a class is scheduled to begin. The only > way I can think of this is to invoke a thread on startup that wakes up > every day and sends emails accordingly. Another issue is that I''ve > heard ActionMail isn''t very good with sending batch emails. > > I suppose I could go back to writing a java program to do this, but I > was wondering what others have done in a similar position. > > Thanks all, have a great day, > > Jin > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Using wget would work, but it might be safer to use the rails runner to execute an ActionMailer model class method instead, like: class DailyMailer < ActionMailer::Base def self.send_daily_mail ... Then, from cron, execute daily: sudo -u apache script/runner ''DailyMailer.send_daily_mail'' Otherwise a user, bot, etc. might accidently hit the public action and trigger the mail inadvertantly. I''m using something like this to send batch emails (a few hundred a day currently) and it is working very well. I''m not sure where you heard ActionMailer isn''t good for batches... Jin Lee wrote:> --===============1596968118=> Content-Type: multipart/alternative; > boundary="----=_Part_38931_15343571.1131131933392" > > ------=_Part_38931_15343571.1131131933392 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > Content-Disposition: inline > > Hey all, > > I realize this probably is beyond the scope of rails, but I was wondering i> f > anyone was using ruby to run a process that sends batch emails daily. I hav> e > a course registration website that needs to send reminder emails the day > before a class is scheduled to begin. The only way I can think of this is t> o > invoke a thread on startup that wakes up every day and sends emails > accordingly. Another issue is that I''ve heard ActionMail isn''t very good > with sending batch emails. > > I suppose I could go back to writing a java program to do this, but I was > wondering what others have done in a similar position. > > Thanks all, have a great day, > > Jin > > ------=_Part_38931_15343571.1131131933392 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > Content-Disposition: inline > > Hey all, <br> > <br> > I realize this probably is beyond the scope of rails, but I was > wondering if anyone was using ruby to run a process that sends batch > emails daily. I have a course registration website that needs to send > reminder emails the day before a class is scheduled to begin. The only > way I can think of this is to invoke a thread on startup that wakes up > every day and sends emails accordingly. Another issue is that I''ve > heard ActionMail isn''t very good with sending batch emails. <br> > <br> > I suppose I could go back to writing a java program to do this, but I was w> ondering what others have done in a similar position.<br> > <br> > Thanks all, have a great day,<br> > <br> > Jin<br> > > ------=_Part_38931_15343571.1131131933392-- > > --===============1596968118=> Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > --===============1596968118==-- >
Using wget would work, but it might be safer to use the rails runner to execute an ActionMailer model class method instead, like: class DailyMailer < ActionMailer::Base def self.send_daily_mail ... Then, from cron, execute daily: sudo -u apache script/runner ''DailyMailer.send_daily_mail'' Otherwise a user, bot, etc. might hit the public action inadvertently and trigger the mail batch. I''m using something like this to send batch emails (a few hundred a day currently) and it is working very well. I''m not sure where you heard ActionMailer isn''t good for batches... Jin Lee wrote:> --===============1596968118=> Content-Type: multipart/alternative; > boundary="----=_Part_38931_15343571.1131131933392" > > ------=_Part_38931_15343571.1131131933392 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > Content-Disposition: inline > > Hey all, > > I realize this probably is beyond the scope of rails, but I was wondering i> f > anyone was using ruby to run a process that sends batch emails daily. I hav> e > a course registration website that needs to send reminder emails the day > before a class is scheduled to begin. The only way I can think of this is t> o > invoke a thread on startup that wakes up every day and sends emails > accordingly. Another issue is that I''ve heard ActionMail isn''t very good > with sending batch emails. > > I suppose I could go back to writing a java program to do this, but I was > wondering what others have done in a similar position. > > Thanks all, have a great day, > > Jin > > ------=_Part_38931_15343571.1131131933392 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > Content-Disposition: inline > > Hey all, <br> > <br> > I realize this probably is beyond the scope of rails, but I was > wondering if anyone was using ruby to run a process that sends batch > emails daily. I have a course registration website that needs to send > reminder emails the day before a class is scheduled to begin. The only > way I can think of this is to invoke a thread on startup that wakes up > every day and sends emails accordingly. Another issue is that I''ve > heard ActionMail isn''t very good with sending batch emails. <br> > <br> > I suppose I could go back to writing a java program to do this, but I was w> ondering what others have done in a similar position.<br> > <br> > Thanks all, have a great day,<br> > <br> > Jin<br> > > ------=_Part_38931_15343571.1131131933392-- > > --===============1596968118=> Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > --===============1596968118==-- >