=== WP Comment Notification ===
Contributors: wpexpertshub, jodhavishalsingh
Tags: comments, comment notification, comment moderation, notification emails, email
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=jodhavishalsingh@gmail.com&item_name=Donation+For+WP+Comment+Notification
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.0

Choose who gets WordPress comment emails: send moderation and new comment notifications to your own list of addresses and the post author.

== Description ==

By default WordPress sends the "Please moderate" email only to the site admin email address (and to the post author when they can edit the comment). On a site with several editors, moderators or a support team, comments easily wait in the moderation queue without anyone noticing.

**WP Comment Notification** lets you decide who receives these emails. Add any number of email addresses, optionally include the author of the post, and choose whether the same people are also told about new approved comments.

= Features =

* **Your own recipient list** - send the "Please moderate" email to any number of addresses, for example your editors, moderators or a shared support inbox.
* **Post author** - optionally email the author of the post that received the comment as well.
* **Approved comments** - optionally send the "New comment" email to the same recipients when a comment is published straight away or approved later.
* **Moderation emails you can rely on** - comments held for moderation are always emailed to your list, whatever the "Email me whenever" options under Settings > Discussion say.
* **No noise** - spam and trashed comments are never emailed, and nobody receives an email about a comment they wrote or approved themselves.
* **Address check** - addresses are validated when you save: invalid ones are skipped and listed, duplicates are removed, and the settings page warns you when nobody would be notified.
* **Standard WordPress emails** - the emails are sent by WordPress itself, so they keep the usual wording, translations and Approve / Trash / Spam links, and work with any SMTP or email log plugin.
* **Works with** pingbacks, trackbacks and WooCommerce product reviews. Block editor notes keep WordPress's own notifications.

= How it works =

1. Go to Settings > WP Comment Notification.
2. Enter the email addresses, separated by commas or one per line.
3. Tick "Notify post author" and "Approved comments" if you want them, and save.

Until you save the settings for the first time, the site admin email address and all administrators receive the moderation emails.

= Privacy =

The plugin only stores its settings. It does not track visitors, set cookies or send data to external services. Emails are sent with your site's normal WordPress mail function.

= For developers =

Change the recipients in code with the `wp_comment_notification_recipients` filter. It receives the email addresses, the comment ID and the context: `moderation` (comment held for moderation) or `approved` (new approved comment).

    add_filter( 'wp_comment_notification_recipients', function ( $emails, $comment_id, $context ) {
        if ( 'moderation' === $context ) {
            $emails[] = 'team@example.com';
        }
        return $emails;
    }, 10, 3 );

== Installation ==

1. Go to Plugins > Add New Plugin, search for "WP Comment Notification", then install and activate it.
2. Go to Settings > WP Comment Notification.
3. Enter the email addresses that should receive comment emails, choose the options you want and save.

== Frequently Asked Questions ==

= Who receives the emails before I save the settings? =

The site admin email address and every administrator of the site.

= I do not receive any emails. What can I check? =

Make sure your address is saved on the settings page and look in your spam folder. If your site does not send any emails at all (password resets included), set up an SMTP plugin: this plugin uses the standard WordPress mail function.

= Why did the person who approved a comment not get the "New comment" email? =

Nobody is emailed about a comment they wrote or approved themselves, just like WordPress does for post authors. All other recipients are still notified.

= Are spam comments emailed? =

No. Comments marked as spam (for example by Akismet) and trashed comments are never emailed.

= Does it work with WooCommerce product reviews? =

Yes. Reviews held for moderation are emailed to your list like any other comment.

= Does the plugin change the notifications for block editor notes? =

No. Notes (WordPress 6.9 and later) are still sent to the post author, as WordPress does by default.

= Does it work on multisite? =

Yes. Every site of the network has its own recipients under Settings > WP Comment Notification.

= What happens to the settings when I delete the plugin? =

They are removed from the database.

= Where can I get help? =

Please open a topic in the [support forum](https://wordpress.org/support/plugin/wp-comment-notification/). Bug reports and feature requests are welcome there too.

== Screenshots ==

1. Settings > WP Comment Notification: the recipient list, the post author option and the approved comments option.

== Changelog ==

= 1.5.0 - 29/09/2026 =
* Fix - Email addresses are validated and sanitised on save (invalid ones are reported and skipped); empty entries no longer cause wp_mail() calls with an empty recipient.
* Fix - Block editor notes (WordPress 6.9+) were sent to the notification list instead of the post author when "Approved comments" was enabled.
* Fix - The person who wrote or approved a comment no longer receives the "New comment" email about it.
* Fix - Settings output escaped; the "Notify post author" checkbox rendered an invalid attribute.
* Fix - The pending comment count used a direct database query; the moderation email is now built by WordPress core, so it keeps core wording and translations.
* New - Option to send the "New comment" email for approved comments and replies to the same recipients.
* New - `wp_comment_notification_recipients` filter.
* Tweak - Settings link on the Plugins screen; settings page uses the standard admin layout and warns when nobody would be emailed.
* Tweak - Settings are removed when the plugin is deleted.
* Tweak - Tested with WordPress 7.1 and PHP 8.2 - 8.5.

= 1.4 - 30/07/2022 =
* Fix - Compatibility Fix.
* Fix - Code updated.

= 1.3 - 09/04/2021 =
* Fix - Compatibility Fix.
* Fix - Code updated.

= 1.2 - 05/11/2019 =
* Fix - Mail notification tweaks.

= 1.1 - 29/07/2017 =
* Fix - Mail notification disabled for comments caught in spam.

= 1.0 - 16/07/2017 =
* Initial Release.

== Upgrade Notice ==

= 1.5.0 =
Validates the saved addresses, adds an optional "New comment" email for approved comments and leaves block editor notes to WordPress. Existing settings are kept.
