Fixes bug 931907 - Rewrote automatic-emails cron job to use elasticsearch, added a classification system to send different emails.