diff options
author | Alex Elman <aelman@indeed.com> | 2014-06-11 20:37:29 +0400 |
---|---|---|
committer | Alex Elman <aelman@indeed.com> | 2014-06-15 18:53:00 +0400 |
commit | e6722cb1786f7765228c2ac81f337ec5d09f9d19 (patch) | |
tree | 2ab5c281fc66b8210fa3e8c362fdf7fb853ec39a /app/mailers | |
parent | 46e33ed3714e876030e796bd5ef53248a8bb79e1 (diff) |
Provide better email subject lines from email on push service
If one commit is pushed, display the commit message in the subject
line. Otherwise display the number of commits pushed to the repository.
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/projects.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb index 6017d9192ec..64878568ef8 100644 --- a/app/mailers/emails/projects.rb +++ b/app/mailers/emails/projects.rb @@ -25,13 +25,15 @@ module Emails @branch = branch if @commits.length > 1 @target_url = project_compare_url(@project, from: @commits.first, to: @commits.last) + @subject = "#{@commits.length} new commits pushed to repository" else @target_url = project_commit_url(@project, @commits.first) + @subject = @commits.first.title end mail(from: sender(author_id), cc: recipient, - subject: subject("New push to repository")) + subject: subject(@subject)) end end end |