Keyword

K2 Comments - Notifications

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 3 weeks ago - 4 years 3 weeks ago #178578 by Goble002
K2 Comments - Notifications was created by Goble002
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]

 
Last edit: 4 years 3 weeks ago by Goble002.

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
4 years 3 weeks ago #178579 by Goble002
Replied by Goble002 on topic K2 Comments - Notifications
I have found this in the meantime :

getk2.org/extend/extensions/k2notify

Please Log in or Create an account to join the conversation.

More
4 years 3 weeks ago #178588 by JoomlaWorks
Replied by JoomlaWorks on topic K2 Comments - Notifications
I don't think it'll work, it's outdated. There are plan to modernize this plugin at some point in the future...

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum