diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-25 16:05:45 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-25 16:20:35 +0300 |
commit | e0c186c35735a2dc9e05e88ad9975ae016c815d9 (patch) | |
tree | c040a133925106da34de651cb88e155988a079fc /app/mailers/emails | |
parent | 0e7d1fd44f057c83c5384618f4599271f9fdd006 (diff) |
Add option to send EmailsOnPush from committer email if domain matches.
See #1809.
Diffstat (limited to 'app/mailers/emails')
-rw-r--r-- | app/mailers/emails/projects.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb index f3a2ae14d35..3b60aed6f9e 100644 --- a/app/mailers/emails/projects.rb +++ b/app/mailers/emails/projects.rb @@ -16,13 +16,13 @@ module Emails subject: subject("Project was moved")) end - def repository_push_email(project_id, recipient, author_id, branch, compare) + def repository_push_email(project_id, recipient, author_id, branch, compare, send_from_committer_email = false) @project = Project.find(project_id) @author = User.find(author_id) @compare = compare @commits = Commit.decorate(compare.commits) @diffs = compare.diffs - @branch = branch + @branch = branch.gsub("refs/heads/", "") @subject = "[#{@project.path_with_namespace}][#{@branch}] " @@ -40,7 +40,7 @@ module Emails @disable_footer = true - mail(from: sender(author_id), + mail(from: sender(author_id, send_from_committer_email), to: recipient, subject: @subject) end |