adding mailer tests and some logging