summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-20 17:43:28 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-25 13:13:27 +0100
commit607f0c05feb2cde82493a36ac43ba5ecd6c71620 (patch)
tree34a0bdd31f5e022ce077475d069f2ec1a6d77dc7 /app
parenta30a56634d3ea44ccfc69c037324b502456f9aba (diff)
downloadgitlab-ce-607f0c05feb2cde82493a36ac43ba5ecd6c71620.tar.gz
Change EmailsOnPush subject to include namespace, repo and branch.
See #1827.
Diffstat (limited to 'app')
-rw-r--r--app/mailers/emails/projects.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 4bc40b35f2d..f2e599ab28b 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -23,21 +23,24 @@ module Emails
@commits = Commit.decorate(compare.commits)
@diffs = compare.diffs
@branch = branch
+
+ @subject = "[#{@project.path_with_namespace}][#{@branch}] "
+
if @commits.length > 1
@target_url = namespace_project_compare_url(@project.namespace,
@project,
from: @commits.first,
to: @commits.last)
- @subject = "#{@commits.length} new commits pushed to repository"
+ @subject << "#{@commits.length} commits: #{@commits.first.title}"
else
@target_url = namespace_project_commit_url(@project.namespace,
@project, @commits.first)
- @subject = @commits.first.title
+ @subject << @commits.first.title
end
mail(from: sender(author_id),
to: recipient,
- subject: subject(@subject))
+ subject: @subject)
end
end
end