Make WordPress Core

Opened 7 weeks ago

Last modified 9 days ago

#63504 new defect (bug)

Email me whenever Anyone posts a comment not working

Reported by: sirlouen's profile SirLouen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch dev-feedback needs-copy-review
Focuses: ui, administration, ui-copy Cc:

Description

Bug Report

Description

Having enabled Settings > Discussion > Email me whenever > Anyone posts, is not delivering any emails

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty 2.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0
    • WP Mail SMTP 4.4.0

Steps to Reproduce

  1. Enable Settings > Discussion > Email me whenever > Anyone posts
  2. Disable Settings > Discussion > Email me whenever > A comment is held for moderation
  3. Create a post
  4. Go and add a comment as another user
  5. 🐞 No email delivered

Expected Results

  • An email should be delivered every time someone posts a comment
  • Note that with "A comment is held for moderation" enabled, moderation emails are correctly sent.

Additional Notes

  • Found this bug through this report in Support Forums. Props phsiii.

Change History (12)

#1 @avinashbhosale
7 weeks ago

Reproduction Report

Description

This report validates that the issue is reproduced.

Environment

  • WordPress: 6.8.1
  • PHP: 8.2.27
  • Server: nginx/1.26.1
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.27)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0
    • WP Mail Logging 1.14.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Steps to Reproduce

  1. Go to Settings > Discussion and then enable the setting - Email me whenever > "Anyone posts a comment"
  2. Disabled the setting - Email me whenever > "A comment is held for moderation"
  3. Save Changes.
  4. Create a post
  5. Login as another user and add a comment on the post
  6. No email received for the added comment

#2 @SirLouen
7 weeks ago

  • Keywords needs-patch good-first-bug added

#3 follow-up: @rollybueno
7 weeks ago

Looks like the value of "Anyone posts a comment" is intended for notifying the comment author instead https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/comment.php#L2429.

It doesn't seems intended for notifying admin when anyone post a new comment.

Last edited 7 weeks ago by rollybueno (previous) (diff)

#4 in reply to: ↑ 3 ; follow-ups: @SirLouen
7 weeks ago

  • Keywords needs-copy-review added; needs-patch good-first-bug removed

Replying to rollybueno:

Looks like the value of "Anyone posts a comment" is intended for notifying the comment author instead https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/comment.php#L2429.

It doesn't seems intended for notifying admin when anyone post a new comment.

That doesn't seem right. Thanks for the reference to the spot in code where it's happening.
I've been digging further, and it’s emailing the post author, not the comment author.

The problem is this copy "Email me whenever anyone posts a comment" is ambiguous.

Who is me?

Proposed Reviewed Copy:

This two checkers should not be grouped. They should be individual.

There are two options

Two groups:

Email the post author whenever [ ] Anyone posts a comment
Email the admins whenever      [ ] A comment is held for moderation

One group:

Comment Email notifications  [ ] Email the post author whenever anyone posts a comment
                             [ ] Email the admins whenever a comment is held for moderation

@sabernhardt you are the UI expert, which looks better to you?

#5 in reply to: ↑ 4 @rollybueno
7 weeks ago

Aha, I see. That is correct, I got mixed up on comment author and post author. I would vote for One group

Replying to SirLouen:

Replying to rollybueno:

Looks like the value of "Anyone posts a comment" is intended for notifying the comment author instead https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/comment.php#L2429.

It doesn't seems intended for notifying admin when anyone post a new comment.

That doesn't seem right. Thanks for the reference to the spot in code where it's happening.
I've been digging further, and it’s emailing the post author, not the comment author.

The problem is this copy "Email me whenever anyone posts a comment" is ambiguous.

Who is me?

Proposed Reviewed Copy:

This two checkers should not be grouped. They should be individual.

There are two options

Two groups:

Email the post author whenever [ ] Anyone posts a comment
Email the admins whenever      [ ] A comment is held for moderation

One group:

Comment Email notifications  [ ] Email the post author whenever anyone posts a comment
                             [ ] Email the admins whenever a comment is held for moderation

@sabernhardt you are the UI expert, which looks better to you?

#6 in reply to: ↑ 4 @sabernhardt
7 weeks ago

  • Component changed from Mail to Comments
  • Focuses ui administration ui-copy added
  • Severity changed from major to normal

UI expert

You give me too much credit. :)

I think keeping both options in one group works.

#6286 proposed changing these to user settings, but this could clarify the labels and legend for the current site settings (closer to #33572).

In ticket:6286#comment:34, @dshanske commented

I would suggest we should change from Email to Notify. Email is not the only form of notification.

That would make the text more like:

Comment notifications  [ ] Notify the post author whenever anyone posts a comment
                       [ ] Notify administrators whenever a comment is held for moderation

This ticket was mentioned in PR #8857 on WordPress/wordpress-develop by @SirLouen.


7 weeks ago
#7

  • Keywords has-patch added

#8 @SirLouen
7 weeks ago

  • Keywords dev-feedback added; needs-copy-review removed

@sabernhardt I've never heard of other types of notifications for this regard.
The original copy included this "Email" part.

Checking the code, wp-includes/pluggable.php in wp_notify_postauthor function, it ultimately sends a wp_mail

#9 @sabernhardt
7 weeks ago

  • Keywords needs-copy-review added

The reference to other type(s) might include notifications within the administration area, though I imagine you could replace the pluggable email notification function with one that sends to Slack or another app/service.

I'll leave the 'needs-copy-review' keyword for further review.

rogerkinsta commented on PR #8857:


9 days ago
#10

This looks like a good update to me.

One suggestion would be to add 'email' to the subheading. So instead of 'Comment notifications' have 'Comment email notifications' to be more clear as to what kind of notification they will recieve.

@SirLouen commented on PR #8857:


9 days ago
#11

@rogerkinsta theoretically there is like a whole fuzz around the idea of upgrading notifications to a wildcard option, not only email. This may probably never happen but the card is on the table. Like being able to hook other services like slack and instead of notifications being sent to email, they could be sent to a slack channel.

rogerkinsta commented on PR #8857:


9 days ago
#12

@SirLouen understood. If the fuzz wants wildcard I am not going to stand in the way.

Note: See TracTickets for help on using tickets.