From a1d65867e8e632482db55c8ddb36c9c0b435a844 Mon Sep 17 00:00:00 2001 From: Darko Date: Tue, 23 May 2017 17:13:37 +0200 Subject: [PATCH 1/2] fix issue #2202 missing new comment notification (preliminary fix) --- oc-includes/osclass/emails.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/oc-includes/osclass/emails.php b/oc-includes/osclass/emails.php index 5696d7d99c..a3e4ecb7e4 100755 --- a/oc-includes/osclass/emails.php +++ b/oc-includes/osclass/emails.php @@ -283,6 +283,15 @@ function fn_email_comment_validated($aComment) { 'alt_body' => $body ); osc_sendMail($emailParams); + + $aItem = array( + 'authorName' => $aComment['s_author_name'], + 'authorEmail' => $aComment['s_author_email'], + 'body' => $aComment['s_body'], + 'title' => $aComment['s_title'], + 'id' => $aComment['fk_i_item_id'] + ); + fn_email_new_comment_user($aItem); } } osc_add_hook('hook_email_comment_validated', 'fn_email_comment_validated'); @@ -1301,6 +1310,3 @@ function _osc_from_email_aux() { $tmp = osc_mailserver_mail_from(); return !empty($tmp)?$tmp:osc_contact_email(); } - - -/* file end: ./oc-includes/osclass/emails.php */ \ No newline at end of file From d96b6630925cff8dc654b79ba9201696cdab2202 Mon Sep 17 00:00:00 2001 From: Darko Date: Thu, 25 May 2017 11:29:22 +0200 Subject: [PATCH 2/2] fix --- oc-includes/osclass/emails.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/oc-includes/osclass/emails.php b/oc-includes/osclass/emails.php index a3e4ecb7e4..ac6a5ee636 100755 --- a/oc-includes/osclass/emails.php +++ b/oc-includes/osclass/emails.php @@ -284,14 +284,16 @@ function fn_email_comment_validated($aComment) { ); osc_sendMail($emailParams); - $aItem = array( - 'authorName' => $aComment['s_author_name'], - 'authorEmail' => $aComment['s_author_email'], - 'body' => $aComment['s_body'], - 'title' => $aComment['s_title'], - 'id' => $aComment['fk_i_item_id'] - ); - fn_email_new_comment_user($aItem); + if (osc_get_preference('notify_new_comment_user')) { + $aItem = array( + 'authorName' => $aComment['s_author_name'], + 'authorEmail' => $aComment['s_author_email'], + 'body' => $aComment['s_body'], + 'title' => $aComment['s_title'], + 'id' => $aComment['fk_i_item_id'] + ); + fn_email_new_comment_user($aItem); + } } } osc_add_hook('hook_email_comment_validated', 'fn_email_comment_validated');