working prototype of emailer cloudcode