Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add user field for project team email communication #3402

Open
mcbouslog opened this issue Jul 7, 2020 · 3 comments
Open

Add user field for project team email communication #3402

mcbouslog opened this issue Jul 7, 2020 · 3 comments

Comments

@mcbouslog
Copy link

Ideally, once a user becomes a project owner, collaborator, or moderator they’d be included in an email list for project teams. A user could opt out from the project team email list from their user email settings, similar to other email communication preferences.

I think an initial question is if it’s ok to automatically include a user in an email list? If we’d prefer a user opts in, then this request is for a new user field similar to beta_email_communication, maybe project_team_email_communication, and the following is not relevant. On the frontend, the checkbox to toggle the field would only be shown if apiClient.type('projects').get({ current_user_roles: ['owner', 'collaborator', 'moderator'], page_size: 1 }) returned results.

If we’re ok with the automatic inclusion in the project team email list, I’m not sure what the edits to the user resource should be. Also, the related email list configuration (https://lists.zooniverse.org/cgi-bin/mailman/admin ?) is integral to this discussion.

Not exclusively, or in any particular order, solutions could include:

A. new user field, boolean, maybe project_team_email_opt_out

  • defaults to false, if opt-out set to true
  • the project team email list query would include something like user.project_team_email_opt_out=false and user role including owner, collaborator, or moderator (Note 1)

B. new user field, support 3 states, maybe project_team_email_status

  • defaults ‘ineligible’ or 0, on owner/collab/mod role creation set to ‘subscribed’ or 1, if opt out set to ‘unsubscribed’ or 2
  • the project team email list query I think would be user.project_team_email_status='subscribed'

C. 2 new user fields, both boolean, one if owner/collab/mod, one for project team email communication preference

  • both default to false, on owner/collab/mod role creation both set to true, if opt out then communication preference field set to false
  • the project team email list query would be for both fields equal to true

Note 1 - current query to create the owner/collab/mod list manually that shows how eligibility via project roles can be determined:

SELECT DISTINCT(u.email)
FROM users u
INNER JOIN memberships ON memberships.user_id = u.id
INNER JOIN user_groups ON user_groups.id = memberships.user_group_id
INNER JOIN access_control_lists acl ON acl.user_group_id = user_groups.id
INNER JOIN projects ON projects.id = acl.resource_id
INNER JOIN user_project_preferences ON user_project_preferences.user_id = u.id
WHERE user_project_preferences.email_communication = true
AND user_project_preferences.project_id = projects.id
AND ('owner' = ANY (acl.roles) or 'collaborator' = ANY (acl.roles) or 'moderator' = ANY (acl.roles))
AND acl.resource_type = 'Project'
AND projects.live = true
AND projects.launch_approved = true
AND projects.state is null
order by email asc;

Mentioning @lcjohnso , @srallen , @camallen , @adammcmaster - though no rush to, or required, response

@lcjohnso
Copy link
Member

lcjohnso commented Jul 9, 2020

Related: #2828 and #2154

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@lcjohnso
Copy link
Member

lcjohnso commented Jan 5, 2021

Not stale, stalebot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants