I have a number of different event-driven emails being sent with action mailer (ex. send an email when a user follows you etc.) and I need to move all of this into resque workers. My question is what is the best way to set up these workers? Should I create a separate file for each type of email being sent, or would it make sense to make one file for all emails and put them each in different classes within that file? The latter makes more sense to me, and if I do that, should I assign all of the emails to the same queue or different queues?
I have a number of different event-driven emails being sent with action mailer (ex.
Share
This is a very subjective question as it really depends on your volume, setup, etc.
For my main project that handles a bunch of e-mail, I have a single Rails mailer class that handles all my notifications, and in turn, I have a single Resque worker to handle mailing those out, all tied to my
:emailqueue.You probably wouldn’t really need to worry about multiple queues until performance became an issue and you needed to start giving higher priority to certain queues, etc.