summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSytse Sijbrandij <sytses@gmail.com>2014-06-16 08:21:46 +0200
committerSytse Sijbrandij <sytses@gmail.com>2014-06-16 08:21:46 +0200
commitf31f101d364ea51bb32a7ed0c8a66ccff7811a15 (patch)
tree2ab5c281fc66b8210fa3e8c362fdf7fb853ec39a
parent46e33ed3714e876030e796bd5ef53248a8bb79e1 (diff)
parente6722cb1786f7765228c2ac81f337ec5d09f9d19 (diff)
downloadgitlab-ce-f31f101d364ea51bb32a7ed0c8a66ccff7811a15.tar.gz
Merge pull request #6831 from pkill/better-email-on-push-subject
Provide better email subject lines from email on push service
-rw-r--r--CHANGELOG1
-rw-r--r--app/mailers/emails/projects.rb4
-rw-r--r--spec/mailers/notify_spec.rb4
3 files changed, 6 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 8fa1fb000ad..1b17bcac32f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -37,6 +37,7 @@ v 7.0.0
- Remove wall feature (no data loss - you can take it from database)
- Dont expose user emails via API unless you are admin
- Detect issues closed by Merge Request description
+ - Better email subject lines from email on push service (Alex Elman)
v 6.9.2
- Revert the commit that broke the LDAP user filter
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
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 453bf2b3e94..ab26b290d77 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -537,7 +537,7 @@ describe Notify do
end
it 'has the correct subject' do
- should have_subject /New push to repository/
+ should have_subject /#{commits.length} new commits pushed to repository/
end
it 'includes commits list' do
@@ -573,7 +573,7 @@ describe Notify do
end
it 'has the correct subject' do
- should have_subject /New push to repository/
+ should have_subject /#{commits.first.title}/
end
it 'includes commits list' do