- Posts: 3
COMMUNITY FORUM
how do u enable notifcations of comments
- Brad Steenkamp
-
Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
for 2.4.1, check out k2autonotify at K2joom.com (will be updated for 2.5.5 hopefully in the near future)
Please Log in or Create an account to join the conversation.
- Brad Steenkamp
-
Topic Author
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- Brad Steenkamp
-
Topic Author
- Offline
- New Member
- Posts: 3
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
I am also waiting on the upgrade...
Please Log in or Create an account to join the conversation.
- Dan Grant
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
see his home page post at www.jiliko.net/
Please Log in or Create an account to join the conversation.
- Dan Grant
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- rawling
-
- Offline
- Junior Member
- Posts: 23
1. Site-configuration-server-post (or edit configuration.php):
public $mailer = 'smtp';
public $smtphost = 'smtp.gmail.com';
public $smtpsecure = 'ssl';
public $smtpport = '465';
and add your google email login and password:
public $smtpuser = '';
public $smtppass = '';
2. Edit file components\com_k2\models\item.php
Near line 1018 seek last 3 line of end of function comment() :
This email address is being protected from spambots. You need JavaScript enabled to view it. with your mail for notification (or more mail wia comma)
4. add to your k2.ini language file:
K2_NEWCOMMENT_EMAIL="New comment from my site"
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- rawling
-
- Offline
- Junior Member
- Posts: 23
Better write my by email - This email address is being protected from spambots. You need JavaScript enabled to view it.
About my previous post: this code work on my real site and localhost (denwer) with php mail function.
This code of mail notification was taken and adapte from free old plugin k2_autoarchiver: getk2.org/community/New-to-K2-Ask-here-first%21/10843-k2-autoarchiver-plugin
Instead gmail can use other mail servers that forward mail to SMTP protocol. This is better than use php mail function (for example for Acymailing), the SMTP certifcate of mail server (in this case gmail) better of certificate of your hosting, ensure that the mails does not put into spam.
Please Log in or Create an account to join the conversation.
- anoush
-
- Offline
- New Member
- Posts: 5
i didn't understand since in comment preference there's email field for report
Please Log in or Create an account to join the conversation.
- rawling
-
- Offline
- Junior Member
- Posts: 23
1) IP address
2) URL of K2 item with komment
$mailer =& JFactory::getMailer();
$config =& JFactory::getConfig();
$sender = array(
$config->getValue( 'config.mailfrom' ),
$config->getValue( 'config.fromname' ) );
$mailer->setSender($sender);
$recipient = explode(",", "[email protected], [email protected]");
$mailer->addRecipient($recipient);
$mailer->setSubject(JText::_('K2_NEWCOMMENT_EMAIL'));
$userIP = $_SERVER['REMOTE_ADDR'];
$baselink = '<a href="'. JURI::base();
$link = K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->catid.':'.urlencode($item->category->alias)). '">Comment Link</a>';
if (!trim($commentURL)=="") {
$commentURL = "Site: ". $commentURL. "<br>";
}
$body = 'Name: '. $userName. '<br/>'. 'E-mail: '. $commentEmail. '<br/>'. $commentURL. 'Comment: '. $commentText. '<br/>'. 'IP: '.$userIP. '<br/>'. 'Comment Link: '.$baselink. $link;
$mailer->setBody($body);
$mailer->isHTML(true);
$mailer->Send();
}
$mainframe->close();
}
Please Log in or Create an account to join the conversation.
- Paul Boutin
-
- Offline
- New Member
- Posts: 11
Please Log in or Create an account to join the conversation.
- robm
-
- Offline
- Senior Member
- Posts: 74
Please Log in or Create an account to join the conversation.
- Tim Lord
-
- Offline
- New Member
- Posts: 2
I've just tried to implement this now on a client site but adding the code to the configuration.php breaks the whole site before I can go any further.
I am trying it on a Joomla 3 site running K2 2.6.6 and it looks like the code is a bit different in the K2 php files as well.
Do you think this could work on Joomla 3 and on the latest version of K2 and if so could you offer any advice on the same please? I really need to get this implemented and it is driving me crazy!
Many thanks in advance
Please Log in or Create an account to join the conversation.