Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

google group member cleanup #357

Closed
compwron opened this issue Jun 20, 2019 · 4 comments
Closed

google group member cleanup #357

compwron opened this issue Jun 20, 2019 · 4 comments
Labels
admin tools Helps the membership coordinator or board administrate member accounts security Relating to the security of app/member data

Comments

@compwron
Copy link
Member

compwron commented Jun 20, 2019

This doesn't require any code change but imo it is work that should be tracked, so here we are. :)

Until #342 is worked on, there is the chance that the google group membership can be out of sync with https://app.doubleunion.org membership. I don't know when we last cleaned that up, so I'm doing a batch now.

Use prod console or https://app.doubleunion.org/admin/memberships.json?locale=en to get all current member info

ok_member_emails = User.all_members.map { |user| [user.email_for_google, user.email] }.flatten.compact.map(&:downcase).uniq.sort

Download members.csv from https://groups.google.com/a/doubleunion.org/forum/#!managemembers/members/members/active

lines = File.open('members.csv').read_lines # download from admin view 
newlines = lines.drop(2) # headers
google_group_members_emails = newlines.map { |l| l.split(',')[0] }.map(&:downcase)

Find mystery emails

should_delete = google_group_members_emails - ok_member_emails

Email draft:
Subject; Double Union email cleanup

Hi! This email address has access to the private Double Union google group, but it is not currently associated with an active member account on https://app.doubleunion.org as either a main email or a google-friendly email. 

I will remove this email from the Double Union google group next week on <DATE> unless you email back before then and let me know which https://app.doubleunion.org account it should be linked to. 

Thanks!
@compwron compwron added admin tools Helps the membership coordinator or board administrate member accounts security Relating to the security of app/member data labels Jun 20, 2019
@compwron
Copy link
Member Author

I sent this first email and I will leave this issue open until I actually delete the extra emails from the group.

@brittag
Copy link
Member

brittag commented Jun 21, 2019

Thanks, this is a great idea!

@compwron
Copy link
Member Author

I just sent a second email reminder to the emails from the above query, planned deletion deadline for the 10 emails found above is still 26 June 2019.

@compwron
Copy link
Member Author

compwron commented Jul 3, 2019

10 emails removed today

ok_member_emails = User.all_members.map { |user| [user.email_for_google, user.email] }.flatten.compact.map(&:downcase).uniq.sort

# irb
lines = File.open('members.csv').readlines # download from admin view
newlines = lines.drop(2) # headers
google_group_members_emails = newlines.map { |l| l.split(',')[0] }.map(&:downcase)
should_delete = google_group_members_emails - ok_member_emails

@compwron compwron closed this as completed Jul 3, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
admin tools Helps the membership coordinator or board administrate member accounts security Relating to the security of app/member data
Projects
None yet
Development

No branches or pull requests

2 participants