added support for email templates