diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-07-26 18:25:29 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-08-03 19:06:15 +0300 |
commit | 4caa5a7e14a8aa1e973662bd1394468eac74f3ad (patch) | |
tree | bd8d1b94b81c34eddb16abb2f553ff59610787d6 /app/services/notification_service.rb | |
parent | a4932d2da72af14eeea99e466117bdb767d111c7 (diff) |
factor out .notifiable_users
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index a094d97a295..8a6ed88923d 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -270,7 +270,7 @@ class NotificationService end def project_was_moved(project, old_path_with_namespace) - recipients = NotificationRecipientService::Recipient.notifiable_users(project.team.members, project, :watch) + recipients = NotificationRecipientService.notifiable_users(project.team.members, project, :mention) recipients.each do |recipient| mailer.project_was_moved_email( @@ -304,10 +304,9 @@ class NotificationService return unless mailer.respond_to?(email_template) - recipients ||= NotificationRecipientService.new(pipeline.project).build_pipeline_recipients( - pipeline, - pipeline.user, - action: pipeline.status + recipients ||= NotificationRecipientService.notifiable_users( + [pipeline.user], pipeline.project, :watch, + custom_action: :"#{pipeline.status}_pipeline" ).map(&:notification_email) if recipients.any? |