Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-25 16:05:45 +0300
committerDouwe Maan <douwe@gitlab.com>2015-02-25 16:20:35 +0300
commite0c186c35735a2dc9e05e88ad9975ae016c815d9 (patch)
treec040a133925106da34de651cb88e155988a079fc /app/mailers/notify.rb
parent0e7d1fd44f057c83c5384618f4599271f9fdd006 (diff)
Add option to send EmailsOnPush from committer email if domain matches.
See #1809.
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r--app/mailers/notify.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 46ead62f75f..00d609cd93c 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -45,10 +45,15 @@ class Notify < ActionMailer::Base
# Return an email address that displays the name of the sender.
# Only the displayed name changes; the actual email address is always the same.
- def sender(sender_id)
+ def sender(sender_id, send_from_user_email = false)
if sender = User.find(sender_id)
address = default_sender_address
address.display_name = sender.name
+
+ if send_from_user_email && sender.email.end_with?("@#{Gitlab.config.gitlab.host}")
+ address.address = sender.email
+ end
+
address.format
end
end