Add email-send, templeate e-mail, and functional tests