fix send mail and using email template