The desired behavior.
The Moderators group convened last week to review the features available for moderators reviewing spam.
Working with @jywarren, we identified that people holding "moderator" roles on the website get a lot of notifications. The following two types of notifications generate the bulk of the notifications to moderators roles:
Analysis:
Based on that conversation, @bronwen9 and I have the following feature request:
Additional context
Thank you. Does anyone have any other ideas or questions?
Hi, this should be pretty straightforward to change; the code segments can be found here:
Initial needs moderation email: https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/models/node.rb#L221
Did you also want the "this was marked as spam" email removed? That is here: https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/controllers/admin_controller.rb#L122
And notification of approval of node is here: https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/controllers/admin_controller.rb#L194
Initial comment moderation email is here: https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/models/comment.rb#L130
Notification of comment marked as spam: https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/controllers/admin_controller.rb#L146
Notification of comment approval: https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/controllers/admin_controller.rb#L170
The actual mailers can be found in this file; EVERYTHING EXCEPT the 2 highlighted functions would be removed; we still want to notify node and comment authors of approval:
Then, all mailer templates for moderators would be removed: https://github.com/publiclab/plots2/tree/master/app/views/admin_mailer
And finally, this will break a lot of tests which protect the mailer functions, so those will need to be removed. There are quite a few; i'll list some here but we'll be able to see them fail and can remove them afterwards:
Actually i think all the others can be found here, so the entire file could be removed:
https://github.com/publiclab/plots2/blob/master/test/unit/admin_mailer_test.rb
This is a lot of code; we should probably do it all in a single PR and carefully check it.
Wow thank you!!!! Yes, thanks for pointing out the "Notification of comment marked as spam" and "Notification of post marked as spam" emails -- they should also be discontinued. Sorry for breaking tests and making extra work on that!
Yay! Thanks! Agree, until we think of a better system, I think an end to
all email (except for alerts to the google group) is best.
On Thu, Sep 5, 2019 at 12:44 PM Liz Barry notifications@github.com wrote:
Wow thank you!!!! Yes, thanks for pointing out the "Notification of
comment marked as spam" and "Notification of post marked as spam" emails --
they should also be discontinued. Sorry for breaking tests and making extra
work on that!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/6246?email_source=notifications&email_token=AB7SDRITATKEJYYBH2GEA3TQIEZNZA5CNFSM4IT62HS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD57ZQYQ#issuecomment-528455778,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB7SDRMWRH7NOEDMJ3HQNCLQIEZNZANCNFSM4IT62HSQ
.
Sorry, you're not breaking the tests! was typing a lot quickly... i just meant that we've protected these features with tests, so removing the features will cause the tests to report failures, so we need to remove the tests too. Just trying to be thorough and warn anyone attempting this in advance, thanks!
I believe we should only remove the mailer calls and not the mailer as we may need them in future. Also, we should try to make all emails async and send them via sidekiq as that'll free up main thread. What do you think @jywarren?
I think this depends on whether we see this as a permanent change, and if
there is no possible case for moderation emails for any use. Things to
consider to make this decision permanent would be:
If we have a reasonable expectation of any of these, we could simply "turn
off" both the emails and the tests, rather than delete them, or we could
base their sending on a configuration file which is enabled in testing, but
off in our production setup. Then the system could be turned on again, or
adapted for a different purpose, but wouldn't have to be rebuilt.
On Thu, Sep 5, 2019 at 5:36 PM Gaurav Sachdeva notifications@github.com
wrote:
I believe we should only remove the mailer calls and not the mailer as we
may need them in future. Also, we should try to make all emails async and
send them via sidekiq as that'll free up main thread. What do you think
@jywarren https://github.com/jywarren?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/6246?email_source=notifications&email_token=AAAF6J7PFKCEY6QRT7HBPZ3QIF3UJA5CNFSM4IT62HS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6A4OPQ#issuecomment-528598846,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAF6JYMK2BTOUPCBADRMULQIF3UJANCNFSM4IT62HSQ
.
Don't know.
Yes, they can be useful.
yes, we can extend this privilege to post author and create a mailer
Another idea is to setup a cron job which will send a mail about the # of new posts pending for moderation as a reminder to moderators group.
This sounds like several good reasons to "turn off" the mailer instead of deleting it. Cool! I especially like the idea that, in the future, topic groups may do their own moderation. I could see that people would be eager to help curate the areas they care about.
Does this also mean that we should "turn off" the tests instead of deleting them?
@bronwen9 proposes, and I support, to send a notification email if a post or comment has been waiting in the queue for 24 hours.
2 thoughts to add - first, "if it's been waiting for 24 hours" we could do
with a DelayedJob - with
SendModeratorEmailJob.set(wait: 1.day).perform_later(node)
https://edgeguides.rubyonrails.org/active_job_basics.html#enqueue-the-job
Second, yes, we should turn off the tests. But - if we want to, let's
identify which of these systems we can adapt into a "24 hour delayed
message" (with a conditional that it not be sent if some condition is
fulfilled: that it's been approved) and make a checklist of what could be
adapted instead of turned off!
Recapping the revised plan:
Thanks @ebarry, just adding detail here:
DelayedJob as described above), on the condition that the content has not yet been approved or spammedhas been approved and has been spammed) and their corresponding tests off, but don't yet delete them👍
Those two tasks can be done as two separate PRs! And in theory, we could do them separately for comments and nodes, so potentially 4 PRs.
Actually, it looks like mailers are already Jobs, in Rails, so we can do:
AdminMailer.notify_node_moderators(node).deliver_later!(wait_until: 24.hours.from_now)
And, we could wrap this line in the conditional:
So, like:
if node.status == 4 # only if it remains unmoderated
mail(
to: "moderators@#{ActionMailer::Base.default_url_options[:host]}",
bcc: moderators,
subject: subject
)
end
Initial implementation here: #6409, but will take some test corrections and debugging to get right, and also will require some manual testing in production.
Would this also resolve this earlier issue about allowing moderators to control their own email settings where their other email settings are controlled? https://github.com/publiclab/plots2/issues/4543
No, this does not affect that issue, thanks!
Just noting that we turned off initial, confirm (spam and not-spam) for nodes, and spam/not-spam for comments, but this #6409 did NOT turn off initial notifications for comments. Will do this next.
Should comment notifications also be held 24 hours?