added getMailTemplate function