Forum: Ruby on Rails Doing max of N tasks per given time

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fbd9cb107fe7c941333d6a3488691989?d=identicon&s=25 Ramon Tayag (ramontayag)
on 2009-01-27 11:28
(Received via mailing list)
Hey everyone,

PROBLEM
I need some help.  I have a Rails app on a VPS that connects to an
external SMTP server that can only send up to 250 emails per hour.  If
I try to send the 251st email, it will just ignore it.

SENDMAIL?
I almost bashed my head trying to setup sendmail so I can send my own
emails, but not all emails were being sent.

FANCY MOVES
I basically want to send up to 250 emails immediately, and queue the
251st email til after the next hour since the max limit of 250 will be
reset.  What can I use/install that does this for me?  If I can avoid
installing postfix and sendmail or some other MTA program, it'll be
way simpler for me.

Thanks,
Ramon Tayag
A6e8497213547aac53e68d57c03ee4af?d=identicon&s=25 Greg (Guest)
on 2009-01-27 19:01
(Received via mailing list)
You should look into AR Mailer:

http://seattlerb.rubyforge.org/ar_mailer/

The basic idea is that rather than actually sending emails, your app
saves emails to the database.  AR Mailer then has an external script
which can be used to send these emails in batches.

Best of luck,

Greg
Fbd9cb107fe7c941333d6a3488691989?d=identicon&s=25 Ramon Tayag (ramontayag)
on 2009-01-28 05:22
(Received via mailing list)
Thanks, Greg.  I've taken a look.

I can have to Mailer models that have different uses: the first could
be for immediate emailing (forgot password, account activation, etc),
and the second, for less immediate email (site notifications,
newsletters, etc) which will be a subclass of ARMailer.

Ramon Tayag
This topic is locked and can not be replied to.