Fix Mailer

* Update mailer method name
* Update references to attributes to use correct reference
* Update mailer template
* Clean up code in mailer definition