diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-25 14:05:45 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-25 14:20:35 +0100 |
commit | e0c186c35735a2dc9e05e88ad9975ae016c815d9 (patch) | |
tree | c040a133925106da34de651cb88e155988a079fc /app/mailers/notify.rb | |
parent | 0e7d1fd44f057c83c5384618f4599271f9fdd006 (diff) | |
download | gitlab-ce-e0c186c35735a2dc9e05e88ad9975ae016c815d9.tar.gz |
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.rb | 7 |
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 |