arooo
arooo copied to clipboard
Follow up with members without google group access
Based on this code, we have a few members who aren't in the google group- maybe they let their invitations expire? We should probably follow up.
We could build this into the admin interface of the app but it would require a closer integration with google groups than we currently have - there are other issues also which have to do with closer google group integration, so maybe this one will get easier over time.
# in heroku
ok_member_email_pairs = User.all_members.map { |user| [user.email_for_google, user.email] }
# in irb
lines = File.open('members.csv').readlines # download from google group admin view
newlines = lines.drop(2) # headers
google_group_members_emails = newlines.map { |l| l.split(',')[0] }.map(&:downcase)
members_not_accepted_to_google_group = ok_member_email_pairs.select { |arr| arr.none? { |email| google_group_members_emails.include?(email&.downcase) } }
puts members_not_accepted_to_google_group.map { |pair| pair.first || pair.last } # prefer the "google" email so users can have calendar access