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

For moderator accounts, add ability to turn off email at /settings #6282

Closed
ebarry opened this issue Sep 12, 2019 · 6 comments · Fixed by #7183 or #7191
Closed

For moderator accounts, add ability to turn off email at /settings #6282

ebarry opened this issue Sep 12, 2019 · 6 comments · Fixed by #7183 or #7191
Labels
add-code-links beginner break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration feature explains that the issue is to add a new feature fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet gci-candidate
Milestone

Comments

@ebarry
Copy link
Member

ebarry commented Sep 12, 2019

Please describe the desired behavior.

This feature request is part of improving the moderators workflow, and was written with @jywarren and @bronwen9.

This feature request is to add the ability to turn of moderator emails per user at /settings.

This feature should only be shown to /moderators and /admins.

Additional context (optional)
Screen Shot 2019-09-12 at 4 58 58 PM

Thanks!

@ebarry ebarry added break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration feature explains that the issue is to add a new feature add-code-links labels Sep 12, 2019
@ebarry

This comment has been minimized.

@jywarren
Copy link
Member

jywarren commented Jan 7, 2020

Copying in line numbers and info from previous issue at #4543 !

Also noting link to VERY similar/related issue at #6867, especially with regard to UI changes that'd need to happen.


  • Let's add a toggle to https://publiclab.org/settings that:
  • when sending moderator emails, causes the site to check user.has_tag('block-node-moderation-emails') before adding that moderator to the list.

The moderators to be notified are collected up in these sections here:

def notify_node_moderators(node)
subject = '[New Public Lab poster needs moderation] ' + node.title
@node = node
@user = node.author
@footer = feature('email-footer')
moderators = User.where(role: %w(moderator admin)).collect(&:email)
mail(
to: "moderators@#{ActionMailer::Base.default_url_options[:host]}",
bcc: moderators,
subject: subject
)
end

We could add lines like:

all_moderators = User.where(role: %w(moderator admin)).collect(&:email)
moderators = []
all_moderators.each do |mod_user|
  moderators << mod_user unless .has_tag('no-moderation-emails')
end

This would be a great FTO!

Follow-ups would be:

  1. write a test for this by adding such a user tag to a testing user account
  2. develop a UI for this at the /settings page, as in Option to not receive email notifications for topics you follow #6867

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!


@jywarren jywarren added fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet and removed hackoctober labels Jan 7, 2020
@anthony-zhou
Copy link
Member

I'd be happy to work on this as part of GCI. I will open a PR addressing this soon.

@jywarren
Copy link
Member

jywarren commented Jan 10, 2020 via email

@SidharthBansal
Copy link
Member

Published on GCI

@jywarren
Copy link
Member

Completed by @anthony-zhou ! Thank you!!!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-code-links beginner break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration feature explains that the issue is to add a new feature fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet gci-candidate
Projects
None yet
6 participants