Refactor sending of emails to a dedicated MailerService, add more config options