[wp-trac] [WordPress Trac] #33717: Send Notification Email When a Comment is Approved From Moderation

WordPress Trac noreply at wordpress.org
Sun Jan 10 17:07:05 UTC 2021


#33717: Send Notification Email When a Comment is Approved From Moderation
--------------------------------------+--------------------------
 Reporter:  jeffr0                    |       Owner:  johnbillion
     Type:  feature request           |      Status:  reviewing
 Priority:  normal                    |   Milestone:  5.7
Component:  Comments                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  needs-dev-note has-patch  |     Focuses:
--------------------------------------+--------------------------

Comment (by johnbillion):

 @imath Thanks for working on this. Overall the functionality looks good.
 Some feedback and questions from me:

 * Themes that call `wp_list_comments()` with a custom comment walker class
 (affects Twenty Twenty, Twenty Nineteen) or a custom callback (affects
 Twenty Eleven, Twenty Ten) don't benefit from this new functionality,
 meaning there's no way to opt in to a notification on the front end with
 such a theme in use. Is there a way we can do one of the following?
   - Inject the checkbox and message using another method so that all
 themes benefit from it
   - Or implement a simple method (eg. calling `do_action()`) for themes to
 use in a backwards-compatible manner
 * On the Comments admin screen and in the Recent Comments section of the
 dashboard the "{author} has opted in to receive a notification on
 comment’s approval" message is shown, but this message isn't shown either
 when editing the comment or when clicking through to approve the comment
 from an email notification. I'm not entirely convinced the message is
 needed, but if it is then it should be shown in these locations too or not
 shown at all.
 * In `wp_new_comment_notify_comment_author()`, the post author is
 prevented from receiving a notification. Is there a reason for this? They
 are able to opt in to receiving one.
 * There are several instances of `0 === (int) $comment->comment_approved`.
 These should be changed to `'0' === $comment->comment_approved` to avoid
 unnecessary type juggling.
 * A test is needed to cover the situation where a user does not opt in to
 a notification and their comment gets approved, to assert that no email is
 sent.
 * The `comment_approval_notification_text` and
 `comment_approval_notification_subject` filters in
 `wp_new_comment_notify_comment_author()` should be replaced with one
 filter that filters the whole array of data for the email. See the
 `new_site_email` as an example.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/33717#comment:70>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list