Add email support, clean-up templates and logic