Keyword

Email notification to item author when a comment i

More
11 years 2 weeks ago #118402 by Ryan
K2 2.6.7
Joomla 3.1.5

Just a quick question. I added the following code to the models/item.php file but I'm not grabbing the item author's email correcty. Any suggestions?

$mainframe = &JFactory::getApplication();
$mail = &JFactory::getMailer();
$senderEmail = $this->item->author->email;
$senderName = $this->item->author->name;
$mail->setSender(array($senderEmail, $senderName));
$mail->setSubject(JText::_('New inquiry from site'));
$mail->IsHTML(true);
$body = JText::_('Your name: ').$userName."
".JText::_('Inquiry: ').nl2br($row->commentText)."
".JText::_('Email: ').$commentEmail."
".JText::_('Phone no.: ').$commentURL."
";
$mail->setBody($body);
$mail->ClearAddresses();
$mail->AddAddress($params->get('itemAuthorEmail'),$mainframe->getCfg('mailfrom'));
$mail->Send();

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


Powered by Kunena Forum