I am using tiki version 15.3 I setup my preference that if there is a new forum thread that I am an editor, I will receive an email notification in "My Watches". However, I haven't received any email. It works for blog and new user registration though. So no problem with the email setup. As I debug the code, I found a few problem in the code: In File: /lib/notification/notificationemaillib.php Line: 112
$nots_raw = $tikilib->get_event_watches($event, $event == 'forum_post_topic'? $forum_info['forumId']: $threadId, $forum_info);
Should the $threadId is the $parentId? Since the Tiki_user_Watch table store the Thread Parent Id not the newly created threadId. Secondly,
In line 122:
foreach ( $nots_raw as $n ) {
if ($n['user'] != $author
&& !in_array($n['user'], $users)) {
// make sure user receive only one notification even if he is monitoring both the topic and thread
$n['language'] = $tikilib->get_user_preference($n['user'], "language", $defaultLanguage);
$nots[] = $n;
$users[] = $n['user'];
}
There is no else for this if clause. I understand this condition is to send only 1 email when user monitor both thread and topic. However, I am monitoring only 1 of them, I think there should be an"
else{ $nots[] = $n;}
This way the $nots will have something to send email in the later part of the code.
if (count($nots)) {
include_once('lib/webmail/tikimaillib.php');
$smarty->assign('mail_forum', $forum_info["name"]);...
Please advise if I am wrong.