mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 04:28:29 -05:00
FEATURE: trigger webhook when a user added/removed in a group. (#12653)
Whenever a group is added or removed from a group a webhook event will get triggered if it's active.
This commit is contained in:
@@ -95,3 +95,8 @@ end
|
||||
DiscourseEvent.on(:notification_created) do |notification|
|
||||
WebHook.enqueue_object_hooks(:notification, notification, :notification_created, NotificationSerializer)
|
||||
end
|
||||
|
||||
DiscourseEvent.on(:user_added_to_group) do |user, group, options|
|
||||
group_user = GroupUser.find_by(user: user, group: group)
|
||||
WebHook.enqueue_object_hooks(:group_user, group_user, :user_added_to_group, WebHookGroupUserSerializer)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user