Question

I want to save the mail sent on certain days (eg.sunday) in database and then send them on next day. I want to know if it is possible.

And how to save the mail object into database.

Was it helpful?

Solution

You'll need to configure a cronjob which is executed every sunday, and which retrieves your mail-content and then sends it out...

OTHER TIPS

You can use delayed_job plugin which is easy to use, you can postpone the long-computing methods to do it later in the background (with optional exact timestamp).

If you end up using cron take a look at the whenever gem. It makes it easy to manage cron jobs.

CollectiveIdea's delayed_job allows you to handle email sending easily. You can call the delay method on any object and it allows you to process anything in background. Checkout the Queuing Jobs section in the documentation.

Yes, delayed job is the best option. The easy tutorial on how to use it is here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top