stcr / subscribe-to-comments-reloaded

Subscribe to Comments Reloaded allows commenters to sign up for e-mail notifications of subsequent replies.
56 stars 32 forks source link

Bug Report: Double notification When notify author enable. #257

Open Reedyseth opened 8 years ago

Reedyseth commented 8 years ago

When the option Subscribe Authors is enable and the author is subscribe to his post two notifications are sent.

image

It should only send one notification if the author is subscribed.

tbartels commented 8 years ago

I have a feeling this is caused by the following code:

https://github.com/stcr/subscribe-to-comments-reloaded/blob/master/subscribe-to-comments-reloaded/wp_subscribe_reloaded.php#L233-L236

despite the code comment, this notifies the admin, not the author

// If the case, notify the author
if ( get_option( 'subscribe_reloaded_notify_authors', 'no' ) == 'yes' ) {
    $this->notify_user( $info->comment_post_ID, get_bloginfo( 'admin_email' ), $_comment_ID );
}

If the option to automatically subscribe authors is selected "Yes" and the author email is the same as the admin email then there will be two calls to notify_user. One via the autosubscribe and one forced in the above code. There's also another potential duplicate in the "BCC admin on Notifications".

Potentially this needs it's own Option "Notify Admin of all new comments", I don't think it should be using the notify_authors option. Hypothetically this is a duplicate of the WP setting in /wp-admin/options-discussion.php for "Email me whenever 'Anyone posts a comment'" and should just be removed.