pboling/capistrano_mailer — pull request #12 by artem-mindrov (2012-06-01 08:49:21+00:00)
Title: Fix for issue #11: failure notifications w/ separately configurable templates and more...

Here's what's in this pull request:
1. Mailer now hooks into Capistrano transaction rollback to send a failure notification. This means that non-transactional failures are not caught. I can't think of a cleaner way to catch failures at this point, so if you have a better idea on how to do this, I'll be glad to hear.
2. Use different templates for success/failure notifications. Default ones are identical, but they use different styles for HTML mail. I've also DRYed up this part a bit, having extracted the styles into external sheets and then used inline-style to inline them back in the markup. Job status is included in the mail subject and text mail body. The new config option is `:template_prefixes` (so that you can define your own .notification_email..erb). I've also renamed `:template_root` to `:template_path` (to be consistent with ActionMailer 3.x).
3. Mailer will now attach deployment logs on specified events (configured with the `:attach_log_on` option, by default attaches logs only on failures). I've used capistrano-log_with_awesome for this.