From ef58ac91e8c23832e657a4f8dee57fe0b7733ae8 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 2 Feb 2009 15:41:47 +0000 Subject: Notifications now send emails when a comment is published. It won't send the email if the comment status is not published. This gives the administrator to moderate the comments prior to being published. --- modules/notification/helpers/notification_event.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/notification/helpers/notification_event.php') diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index e7c7aac1..6336733a 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -35,10 +35,14 @@ class notification_event_Core { } static function comment_created($comment) { - notification::send_comment_added($comment); + if ($comment->state == "published") { + notification::send_comment_published($comment); + } } static function comment_updated($old, $new) { - notification::send_comment_changed($old, $new); + if ($new->state == "published" && $old->state != "published") { + notification::send_comment_published($new); + } } } -- cgit v1.2.3