Create notification recipient class for change_users_role_on_team_activity [SCI-9847]

This commit is contained in:
Ivan Kljun 2023-12-07 14:36:12 +01:00
parent 152522341c
commit aa04e9014c
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -96,7 +96,7 @@ class NotificationExtends
},
change_users_role_on_team_activity: {
code: 94,
recipients_module: :AssignedRecipients
recipients_module: :UserChangedRecipient
}
}