diff --git a/app/notifications/recipients/user_changed_recipient.rb b/app/notifications/recipients/user_changed_recipient.rb new file mode 100644 index 000000000..bee5f9ee5 --- /dev/null +++ b/app/notifications/recipients/user_changed_recipient.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class Recipients::UserChangedRecipient + def initialize(params) + @params = params + end + + def recipients + activity = Activity.find(@params[:activity_id]) + User.where(id: activity.values.dig('message_items', 'user_changed', 'id')) + end +end diff --git a/config/initializers/extends/notification_extends.rb b/config/initializers/extends/notification_extends.rb index 8a793c1e2..1d05b2203 100644 --- a/config/initializers/extends/notification_extends.rb +++ b/config/initializers/extends/notification_extends.rb @@ -96,7 +96,7 @@ class NotificationExtends }, change_users_role_on_team_activity: { code: 94, - recipients_module: :AssignedRecipients + recipients_module: :UserChangedRecipient } }