I''m trying to get certain emails sent at a certain datetime. So I have a column in my table called "due_by", as soon as it''s overdue is it possible to get an automatic email notification? How do people get stuff like this to happen via. Rails without user interaction? TIA Luke -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You would need some sort of script that queues your table for any email notifications that are due. An easy way to do this with your AR models is to make a rake task which checks for any items due and sends them. You could have this run every 5 minutes or so using a cron job. A more advanced solution might offload this to an external queue which your script could poll from in an infinite loop. Just some ideas... On Jan 14, 8:13 pm, Luke Grimstrup <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m trying to get certain emails sent at a certain datetime. > So I have a column in my table called "due_by", as soon as it''s overdue > is it possible to get an automatic email notification? > > How do people get stuff like this to happen via. Rails without user > interaction? > > TIA > Luke > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hmm, yeah I thought about just making it a cronjob, but I''m not too sure if an external infinite loop is a good idea.. Is a cronjob the most common method of getting it done? or is there something else that everyone uses? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
backgroundrb lets you schedule ruby tasks like cronjobs. On Jan 15, 2008 3:25 PM, Luke Grimstrup <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hmm, yeah I thought about just making it a cronjob, but I''m not too sure > if an external infinite loop is a good idea.. > > Is a cronjob the most common method of getting it done? or is there > something else that everyone uses? > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It doesn''t have to be a cron job. You can just have your app run an infinite loop e.g.: loop do # script code end and then manage this script with god. It''d be more responsive this way. On Jan 14, 8:55 pm, Luke Grimstrup <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hmm, yeah I thought about just making it a cronjob, but I''m not too sure > if an external infinite loop is a good idea.. > > Is a cronjob the most common method of getting it done? or is there > something else that everyone uses? > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
A loop like that would have serious performance implications on the server if it''s hitting the database, checking a couple of values and sending emails each trip wouldn''t it? Oh, btw Ryan, cheers for backgroundrb, that looks good. I might use that. eggie5 wrote:> It doesn''t have to be a cron job. You can just have your app run an > infinite loop e.g.: > > loop do > # script code > end > > and then manage this script with god. It''d be more responsive this > way. > > On Jan 14, 8:55 pm, Luke Grimstrup <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
"A more advanced solution might offload this to an external queue which your script could poll from in an infinite loop. " How would that effect your local database? On Jan 14, 9:23 pm, Luke Grimstrup <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> A loop like that would have serious performance implications on the > server if it''s hitting the database, checking a couple of values and > sending emails each trip wouldn''t it? > > Oh, btw Ryan, cheers for backgroundrb, that looks good. I might use > that. > > eggie5 wrote: > > It doesn''t have to be a cron job. You can just have your app run an > > infinite loop e.g.: > > > loop do > > # script code > > end > > > and then manage this script with god. It''d be more responsive this > > way. > > > On Jan 14, 8:55 pm, Luke Grimstrup <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---