Confirmation Email to a list

philstan 11 May, 2009
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 );
}
GreyHead 12 May, 2009
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
philstan 19 May, 2009
That's perfect, just what I needed to know. Thank you Greyhead
This topic is locked and no more replies can be posted.