Problem/Motivation

It can be helpful for a site admin to be notified of any comments made on the site, even if they aren't the author of the node nor hasn't commented on the node.

Proposed resolution

Add a permission to be notified of all comments posted to the site.

Remaining tasks

  1. ❌ Decide whether this feature is appropriate to include in the Comment Notify project
  2. ❌ If yes, write a patch implementing the proposed resolution
  3. ❌ If no, update the Comment Notify project description to mention the SCN module as an approach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna created an issue. See original summary.

jimmy_sebastian’s picture

Assigned: Unassigned » jimmy_sebastian
workplaysleep’s picture

+1 for this feature, since rules is still in beta (and might be overkill for just this feature)

david.qdoscc’s picture

Even better than simply notifying the site admin would be to notify all users with selected role(s) for comment notifications, with the additional option of selecting whether to notify just new unapproved comments or all comments.

nkoporec’s picture

Status: Active » Needs review
FileSize
6.1 KB

Created a patch, which adds a new permission All comments.It sends the notification to all users with this permission.Added a new config message template so you can modify it.

Status: Needs review » Needs work

The last submitted patch, 5: comment_notify_send_to_all_users_2926228_5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

nkoporec’s picture

Status: Needs work » Needs review
FileSize
6.79 KB

Added config schema.

Status: Needs review » Needs work

The last submitted patch, 7: comment_notify_send_to_all_users_2926228_6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jimmy_sebastian’s picture

Assigned: jimmy_sebastian » Unassigned
david.qdoscc’s picture

Thank you for this patch. It works as described. It is still just for when the comments are published isn't it? Any chance of getting it to also notify of unpublished comments, so the editor can go in and approve them?

jurgenhaas’s picture

kbrodej’s picture

Hi. I reviewed the patch from #11. There was an issue with tests which should be ok now.

Also I added the requested feature in #10

kbrodej’s picture

Revisited the issue, found the reason why test were failing was in wrong method call in test itself. Created a patch which should fix the issue.

attisan’s picture

Status: Needs review » Needs work

found multiple problems with this patch.

  • $users = User::loadMultiple(); should be avoided at all costs. this does not scale at all and renders sites with thousands of users broken as no amount of php memory limit would suffice loading all users objects. what is worse: in most cases it will work, but slow down commenting severely with little to no effect (depending if anyone has the permission or not).
  • _comment_user_accounts_to_notify_send($comment, [$comment->getAuthorEmail()]); when deleting a comment does not work as the signature requires a third argument to be passed along.
greggles’s picture

There is another module at https://www.drupal.org/project/scn which provides this feature.

In my opinion it would be appropriate to turn this issue into "document the SCN module on the project page" and focus folks who want that feature to that module.

ivnish’s picture

Thanks, @greggles!

It's my module. Also my module can sent notifications to telegram

cedewey’s picture

Title: Optionally notify site admin of all comments » Add a permission to be emailed anytime a comment is posted
Issue summary: View changes

I've updated the issue title and description to reflect this feature request and that this needs a decision on whether this feature is appropriate for this module.

My two cents is that it is not. The stated purpose of this module is, "Comment Notify is a lightweight tool to send notification e-mails to visitors about new, published comments on pages where they have commented."

The scope of this module has already expanded to also include authors being notified of comments on their content.

There is already an alternative module, Simple Comment Notify which provides this functionality.

greggles’s picture

Status: Needs work » Closed (won't fix)

I think that's enough discussion and agreement - this is a useful feature for other modules.

Thanks for your thoughts, cedewey.