Fix issues with mailer and export mailer