Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails: Best way to schedule emails

Scenario: "I have 500 different types of posts (So emails are being sent various scheduled days exactly at 7 o'clock in the morning). A user signs up to receive 1 or more of those types of posts every day via email (keep in mind, this could mean 5,000+ emails per day)."

Looking around SO, I keep seeing the "Whenever" gem come up as a solution but some are saying that it could cause spikes in the server. I also read some posts on delayed_job but some say that it freezes which I do not want to happen. I googled some more & still could not find anything close to being specific to my question.

What would be the best way to handle this, given my scenario & why?

Thank you in advance.

like image 311
Jon Avatar asked Oct 18 '25 01:10

Jon


1 Answers

Use:

http://rubygems.org/gems/resque

in conjunction with:

https://rubygems.org/gems/resque_mailer

The best part is that you won't have to change the code, you just can send them like you did with ActionMailer!

like image 167
bluehallu Avatar answered Oct 19 '25 14:10

bluehallu