diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-07-19 01:04:43 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-07-23 13:00:53 +0800 |
commit | 40d6d5e2d0123f1417bb5d3d1ead47bd525f8dac (patch) | |
tree | 1536ffad5f7c1a28ad2ca645a098a29b4bc2834d /app/mailers | |
parent | 17fe03078d003dc61a456da8d3e41e3e52ba4f54 (diff) | |
download | gitlab-ce-40d6d5e2d0123f1417bb5d3d1ead47bd525f8dac.tar.gz |
Make pipeline emails respect group email setting63485-fix-pipeline-emails-to-use-group-setting
When a user's notification email is set for a group, we
should use that for pipeline emails
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/notify.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 576caea4c10..8ef20a03541 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -78,17 +78,7 @@ class Notify < BaseMailer # # Returns a String containing the User's email address. def recipient(recipient_id, notification_group = nil) - @current_user = User.find(recipient_id) - group_notification_email = nil - - if notification_group - notification_settings = notification_group.notification_settings_for(@current_user, hierarchy_order: :asc) - group_notification_email = notification_settings.find { |n| n.notification_email.present? }&.notification_email - end - - # Return group-specific email address if present, otherwise return global - # email address - group_notification_email || @current_user.notification_email + User.find(recipient_id).notification_email_for(notification_group) end # Formats arguments into a String suitable for use as an email subject |