convert mail template editor to app framework for a restful api