DEV: Trigger 'user_added_to_group' when accepting invite with groups (#9561)

DEV: Trigger ‘user_added_to_group’ when accepting invite with groups (#9561)

diff --git a/app/models/invite_redeemer.rb b/app/models/invite_redeemer.rb
index 172e06f..d4e9392 100644
--- a/app/models/invite_redeemer.rb
+++ b/app/models/invite_redeemer.rb
@@ -124,6 +124,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name, :password, :user_custom_f
     new_group_ids = invite.groups.pluck(:id) - invited_user.group_users.pluck(:group_id)
     new_group_ids.each do |id|
       invited_user.group_users.create(group_id: id)
+      DiscourseEvent.trigger(:user_added_to_group, invited_user, Group.find_by(id: id), automatic: false)
     end
   end
 

GitHub sha: 051e6be7