1

I am working on an application which people can sign up to and schedule tasks to be done.

When the user schedules a task they enter a date and time. I want the application to wake up and send an email to the user at the date and time they have entered.

I am unsure what gems/plugins to use in rails to achieve this, anyone have a suggestion?

Cheers

Eef

RailsSon
  • 19,897
  • 31
  • 82
  • 105

4 Answers4

2

delayed_job should do the trick. It allows you to schedule tasks to run at a particular time. All you need to do is schedule a function that sends an email.

Alex Korban
  • 14,916
  • 5
  • 44
  • 55
1

Run a cron job every minute that runs a rake task that checks the database for any un-run tasks in the past.

This way if your system goes down (hint: it will) when you bring it back up the cronjob will pick up the slack left behind.

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
0

There's also a backgroundrb. Also check this thread.

Community
  • 1
  • 1
Roman
  • 13,100
  • 2
  • 47
  • 63
0

The Unix 'at' command is also useful. Just execute a shell that calls 'at'.

Teddy
  • 18,357
  • 2
  • 30
  • 42