Sync group membership with external list of email addresses

If you don’t have those users managed in some external application then you could do something like this:

  def load_csv(path)
    CSV.parse(File.read(path), headers: true)
  end

  def update_group
   g=Group.find(43) #whatever group ID yo uwant
   GroupUser.where(group_id: g.id).destroy_all
   user_emails=load_csv('/path/to/file')
    user_emails.each do |u|
      user = User.find_by_email(u['Email'])
      next unless user
      puts "found user #{uid}"
      GroupUser.find_or_create_by(group_id: g.id, user_id: user.id)
    end
  end

Just how is a whole nother issue. A plugin, perhaps.

Maybe a plugin that automatically adds a user to the group if they post in the category?