This was caused by renaming the mailer without renaming the layout. Added a test to cover this in future. Fixes #2903