Extracted the mail to separate templates and moved all configuration to a conf.php