Plots2: Feature request: delay moderation emails for first time posters or commenters until 24 hours have passed

Created on 5 Sep 2019  ·  19Comments  ·  Source: publiclab/plots2

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:

  • moderator roles: When a First Time Poster posts a note or a comment
  • moderator roles: When another moderator takes action on a note or comment

Analysis:

  • These type of notifications are completely redundant with the listing of spam on the dashboard.
  • responding to the request to approve or spam the new submission still requires clicking through to the website, so these emails do not streamline the activities of performing moderation duties.
  • For the past couple years, it has become reliable that there are daily submissions by new posters, making even a daily digest email notification redundant.

Based on that conversation, @bronwen9 and I have the following feature request:

  • [ ] Eliminate the email titled “[New Public Lab poster needs moderation]”
  • [ ] Eliminate the email titled "[New Public Lab commenter needs moderation]"

Additional context

Thank you. Does anyone have any other ideas or questions?

break-me-up feature help wanted

All 19 comments

Hi, this should be pretty straightforward to change; the code segments can be found here:

Notes

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

Comments

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:

https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/app/mailers/admin_mailer.rb#L32-L48

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:

https://github.com/publiclab/plots2/blob/b6d5089c5ac3b80ef48481a6753f39b8dc0812ca/test/functional/comment_controller_test.rb#L280-L284

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:

  • could such emails be used as part of integration with another system,
    like IFTTT or anything?
  • could such emails be useful for someone else running the PL codebase for
    another community, and do we want to preserve such capability?
  • could such emails be useful for authors to be notified of spam comments
    on their posts so they can moderate them themselves, or
  • could such emails be useful for topic groups to do their own moderation,
    rather than having a central moderators group?

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
.

  • could such emails be used as part of integration with another system,
    like IFTTT or anything?

Don't know.

  • could such emails be useful for someone else running the PL codebase for
    another community, and do we want to preserve such capability?

Yes, they can be useful.

  • could such emails be useful for authors to be notified of spam comments
    on their posts so they can moderate them themselves, or

yes, we can extend this privilege to post author and create a mailer

  • could such emails be useful for topic groups to do their own moderation,
    rather than having a central moderators group?
    yes.

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:

  • [x] email notifications on 24 hour delay, on a conditional that email not be sent if content has been approved
  • [x] confirmations off

Thanks @ebarry, just adding detail here:

  • [x] change initial moderator email notifications for comments and nodes to send after a 24 hour delay (using DelayedJob as described above), on the condition that the content has not yet been approved or spammed
  • [x] turn confirmations (has 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:

https://github.com/publiclab/plots2/blob/dc166a01fc474facefaa412b7d826d9a444d8f43/app/mailers/admin_mailer.rb#L12-L16

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

first-timers[bot] picture first-timers[bot]  ·  3Comments

bronwen9 picture bronwen9  ·  3Comments

grvsachdeva picture grvsachdeva  ·  3Comments

milaaraujo picture milaaraujo  ·  3Comments

grvsachdeva picture grvsachdeva  ·  3Comments