Add test coverage for the action mailer

Add test coverage for the action mailer.
Additionally update code according to a style guide.