-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Feature request: delay moderation emails for first time posters or commenters until 24 hours have passed #6246
Comments
Hi, this should be pretty straightforward to change; the code segments can be found here: NotesInitial needs moderation email: Line 221 in b6d5089
Did you also want the "this was marked as spam" email removed? That is here: plots2/app/controllers/admin_controller.rb Line 122 in b6d5089
And notification of approval of node is here: plots2/app/controllers/admin_controller.rb Line 194 in b6d5089
CommentsInitial comment moderation email is here: Line 130 in b6d5089
Notification of comment marked as spam: plots2/app/controllers/admin_controller.rb Line 146 in b6d5089
Notification of comment approval: plots2/app/controllers/admin_controller.rb Line 170 in b6d5089
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: plots2/app/mailers/admin_mailer.rb Lines 32 to 48 in b6d5089
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: plots2/test/functional/comment_controller_test.rb Lines 280 to 284 in b6d5089
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 ***@***.***> 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
<#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 ***@***.***> 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
<#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:
👍 |
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: plots2/app/mailers/admin_mailer.rb Lines 12 to 16 in dc166a0
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? #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. |
plots2/test/functional/admin_controller_test.rb Lines 550 to 566 in 08ab5c0
Should comment notifications also be held 24 hours? |
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?
The text was updated successfully, but these errors were encountered: