Send Mail with Backgrounded Mail

Ryan Sonnek bio photo By Ryan Sonnek

This is what life was like before backgrounded_mail…

Don’t tie up your precious resources blocking on a synchronous call to sendmail or SMTP!  Use the backgrounded_mail gem to make your application more responsive and deliver email using your background processing library.

The background_mail API is very straightforward.  Instead of invoking ‘deliver’ on the mail object, simply use the ‘deliver_backgrounded’ method to push the email into your background processing queue.

ex:

UserNotifier.welcome(user).deliver_backgrounded

The backgrounded_mail gem is compatible with Rails3 or any project using the mail gem.  It is built on the world class backgrounded library to enqueue email delivery using your background processing library of choice (ex: resque, delayed job, workling, etc).

Sourcecode is available on Github.

https://github.com/wireframe/backgrounded_mail