summaryrefslogtreecommitdiff
path: root/app/services/notification_recipient_service.rb
diff options
context:
space:
mode:
authorStuart Nelson <stuartnelson3@gmail.com>2018-02-06 19:09:59 +0100
committerSean McGivern <sean@gitlab.com>2018-03-26 08:10:19 +0100
commit5f39f9b30853291ec83df2383cd2e7863b72fb27 (patch)
treeba59e062a442f0e796a25d176a6774efd1983cde /app/services/notification_recipient_service.rb
parentbebced8fc9039c5e8a3774af183a8dd9c244f297 (diff)
downloadgitlab-ce-5f39f9b30853291ec83df2383cd2e7863b72fb27.tar.gz
Send email to recipients
Diffstat (limited to 'app/services/notification_recipient_service.rb')
-rw-r--r--app/services/notification_recipient_service.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb
index e4be953e810..c7c64356e30 100644
--- a/app/services/notification_recipient_service.rb
+++ b/app/services/notification_recipient_service.rb
@@ -230,14 +230,20 @@ module NotificationRecipientService
add_subscribed_users
- if [:new_issue, :new_merge_request].include?(custom_action)
+ if [:new_issue, :new_merge_request, :due_date_issue].include?(custom_action)
# These will all be participants as well, but adding with the :mention
# type ensures that users with the mention notification level will
# receive them, too.
add_mentions(current_user, target: target)
# Add the assigned users, if any
- assignees = custom_action == :new_issue ? target.assignees : target.assignee
+ assignees = case custom_action
+ when :new_issue, :due_date_issue
+ target.assignees
+ else
+ target.assignee
+ end
+
# We use the `:participating` notification level in order to match existing legacy behavior as captured
# in existing specs (notification_service_spec.rb ~ line 507)
add_recipients(assignees, :participating, NotificationReason::ASSIGNED) if assignees