Some code for users authentication and email templates