Add comments
Refactorings: Create method for mail generation / remove unused code / add additional vars to settings