Hello,
I would like to get notified of K2 comments for approval.
BNR Comment Notify for K2 is no more available on JED.
I have tried the codes from
here
and I do received email, however:
K2_COMMENT_ADDED_AND_WAITING_FOR_APPROVAL won't show up. Seems there are minor tweaks to be brought to this solution that has more than 8 years.
Code added:
$mainframe = &JFactory::getApplication();
$mail = &JFactory::getMailer();
$senderEmail = $mainframe->getCfg('mailfrom');
$senderName = $mainframe->getCfg('fromname');
$mail->setSender(array($senderEmail, $senderName));
$mail->setSubject(JText::_('K2_COMMENT_REPORT'));
$mail->IsHTML(true);
$body = "
<strong>".JText::_('K2_NAME')."</strong>: ".$name." <br/>
<strong>".JText::_('K2_REPORT_REASON')."</strong>: ".$reportReason." <br/>
<strong>".JText::_('K2_COMMENT')."</strong>: ".nl2br($row->commentText)." <br/>
";
$mail->setBody($body);
$mail->ClearAddresses();
$mail->AddAddress($params->get('commentsReportRecipient', $mainframe->getCfg('mailfrom')));
$mail->Send();
Just before this code:
[code] $response->message = JText::_('K2_COMMENT_ADDED_AND_WAITING_FOR_APPROVAL');
$response->cssClass = 'k2FormLogSuccess';
echo json_encode($response);
}
}
$app->close();
}
[/code]