Return of duplicate email notifactions for blog comments
Please refer to Bug #10800
#2 Updated by Gina Cherry almost 3 years ago
This has happened with the last several blog comments. Here is the most recent example: https://cetls.bmcc.cuny.edu/blog/2019/01/25/race-racism-teaching/
All of the blog comments from the last few months have been flagged as spam, which I need to release and then approve since comments on this blog are moderated. It would be great if we could also figure out why this is happening. Since I don’t receive email notifications about spam, it means I have to remember to check for comments every day.
#3 Updated by Boone Gorges almost 3 years ago
- Target version set to 1.14.8
Thanks for these additional details, Gina. The spam issue sounds suspicious to me. It suggests that there may be a couple related issues: 1. Unspamming a blog comment double-triggers the notification process, and 2. Spam filters are being overly aggressive for your site. We'll investigate.
Regarding email notifications about spam, the site appears to be configured to send an email to firstname.lastname@example.org whenever a comment is sent to spam. https://bmcccetls.commons.gc.cuny.edu/wp-admin/options-discussion.php Are you checking the proper inbox? Perhaps those notifications are being sent to spam for some reason?
#4 Updated by Gina Cherry almost 3 years ago
Thanks, Boone. I'm fairly sure that the spam comment notifications are not being sent to email spam. I have not seen these notifications in the email spam for either the CETLS account or my personal account. There have been blog comments in the past that were not sent to spam. In those cases, I received notifications at both the CETLS email and my personal email.
#6 Updated by Raymond Hoh almost 3 years ago
- Category name set to Email Notifications
- Status changed from New to Resolved
I outlined the problem here: https://redmine.gc.cuny.edu/issues/10800#note-8
To summarize, for anonymous blog comments, there are two email actions being fired:
// First save by BP Include Non-Member Comments do_action('wp_ajax_dim-comment'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wp_ajax_dim_comment, wp_set_comment_status, do_action('wp_set_comment_status'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, bp_blogs_record_nonmember_comment_approved, bp_blogs_record_nonmember_comment, bp_blogs_record_activity, bp_activity_add, BP_Activity_Activity->save, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, ass_group_notification_activity // Second save by BP Group Email Subscription do_action('wp_ajax_dim-comment'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wp_ajax_dim_comment, wp_set_comment_status, wp_transition_comment_status, do_action('transition_comment_status'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, bp_activity_transition_post_type_comment_status, BP_Activity_Activity->save, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, ass_group_notification_activity
To address the problem, we let the first save through, but then remove the second save from happening.
My previous attempt at fixing this by blocking duplicate queued items from being recorded from sending appears to only address group digests and not immediate email sendouts.
I have deployed this as a hotfix on production. Gina, please reopen and let me know if you are still experiencing duplicate email notifications after unspamming a comment.