mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Create notification recipient class for change_users_role_on_team_activity [SCI-9847]
This commit is contained in:
parent
152522341c
commit
aa04e9014c
2 changed files with 13 additions and 1 deletions
12
app/notifications/recipients/user_changed_recipient.rb
Normal file
12
app/notifications/recipients/user_changed_recipient.rb
Normal 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
|
|
@ -96,7 +96,7 @@ class NotificationExtends
|
|||
},
|
||||
change_users_role_on_team_activity: {
|
||||
code: 94,
|
||||
recipients_module: :AssignedRecipients
|
||||
recipients_module: :UserChangedRecipient
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue