Folks,
A while ago i wrote and used a lib in Ruby for several cases. This lib is an email alert from SQL queries. I put on github https://github.com/edmartins/robotboy, who are interested in taking a look, use, contribute, etc. will be very grateful.
Best regards.