Fixes bug 931907 - Rewrote automatic-emails cron job to use elasticsearch and support classifications.

@peterbe r?
@twobraids Can you take a look at my use of ``TransformRuleSystem`` and at the small changes I made?