Thank you for your great product.
I'm using ChronoComments as part of a community site that I am building and I would like it to notify all the people in a group when a comment is added to a group page (ie a Joomla Article). I have added the following to the core chronocomments.php but nothing is happening. (no mail, no error message). May I ask you guys for some help with this.
Thank you in advance.
//send email to everyone in the Group
$email_elements = array(
'{br}' => '<br>',
'{sitename}' => $mainframe->getCfg('sitename'),
'{commentlink}' => JRoute::_(JURI::Base().'index.php?option='.$row->component.'&id='.$row->pageid.'&view=article#commentID'.$row->id)
);
$email_body = $configs->get('nemail_body');
$db =& JFactory::getDBO();
//Take the article id and check the database for all users associated with this id
$query = "SELECT cf_user_id FROM jos_chronoforms_Group_Members WHERE articleid =".$row->pageid."";
$db->setQuery($query);
$group_members_return = $db->loadResultArray();
//now search the Joomla User's table for their email addresses
$group_members = implode (",", $group_members_return);
$query2 = "SELECT * FROM jos_users WHERE id IN (".$group_members.")";
$rows = $db->loadObject();
//send them notification that an update has been made to their group
$subject = "New comment to your Group";
foreach($rows as $row){
JUtility::sendMail($configs-get('nemail_fromemail'), $configs->get('nemail_fromname'), $row->email, $subject. $email_body. true, NULL, NULL, NULL, NULL, NULL );
}
I'm using ChronoComments as part of a community site that I am building and I would like it to notify all the people in a group when a comment is added to a group page (ie a Joomla Article). I have added the following to the core chronocomments.php but nothing is happening. (no mail, no error message). May I ask you guys for some help with this.
Thank you in advance.
//send email to everyone in the Group
$email_elements = array(
'{br}' => '<br>',
'{sitename}' => $mainframe->getCfg('sitename'),
'{commentlink}' => JRoute::_(JURI::Base().'index.php?option='.$row->component.'&id='.$row->pageid.'&view=article#commentID'.$row->id)
);
$email_body = $configs->get('nemail_body');
$db =& JFactory::getDBO();
//Take the article id and check the database for all users associated with this id
$query = "SELECT cf_user_id FROM jos_chronoforms_Group_Members WHERE articleid =".$row->pageid."";
$db->setQuery($query);
$group_members_return = $db->loadResultArray();
//now search the Joomla User's table for their email addresses
$group_members = implode (",", $group_members_return);
$query2 = "SELECT * FROM jos_users WHERE id IN (".$group_members.")";
$rows = $db->loadObject();
//send them notification that an update has been made to their group
$subject = "New comment to your Group";
foreach($rows as $row){
JUtility::sendMail($configs-get('nemail_fromemail'), $configs->get('nemail_fromname'), $row->email, $subject. $email_body. true, NULL, NULL, NULL, NULL, NULL );
}
Hi philstan,
The core code will not understand the {br} syntax, you'll need to replace each of these with the corresponding $_REQUEST value using e.g. $br = JRequest::getVar('br', '', 'post') making sure that you check the variable types and values appropriately.
Bob
The core code will not understand the {br} syntax, you'll need to replace each of these with the corresponding $_REQUEST value using e.g. $br = JRequest::getVar('br', '', 'post') making sure that you check the variable types and values appropriately.
Bob
This topic is locked and no more replies can be posted.
