Refactoring download emailing using freemarker and changing error and success text