Skip to content

Commit

Permalink
Fixed subject line formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Jan 13, 2010
1 parent a3392c1 commit 30e9e86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG
@@ -1,3 +1,6 @@
Version 3.2.4 2010-01-13
- Fixed subject line format (mail client filters are based on format of subject line)

Version 3.2.3 2010-01-13
- config[:user] is now optional.

Expand Down
5 changes: 4 additions & 1 deletion lib/cap_mailer.rb
Expand Up @@ -89,7 +89,10 @@ def notification_email(cap, config = {}, *args)
private

def subject_line
config[:subject] || config[:user] ? "[#{config[:application]}] #{inferred_command} by #{config[:user]}" : "[#{config[:application]}] #{inferred_command}"
#The subject prepend and append are useful for people to setup filters in mail clients.
user = config[:user] ? " by #{config[:user]}" : ""
middle = config[:subject] ? config[:subject] : "[#{config[:rails_env].upcase}][#{repo_end}] #{inferred_command}#{user}"
"#{config[:subject_prepend]}#{middle}#{config[:subject_append]}"
end

def body_data_hash
Expand Down

0 comments on commit 30e9e86

Please sign in to comment.