Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: notification to authors of articles
Pages: [1]   Go Down
  Print  
Author Topic: notification to authors of articles  (Read 581 times)
0 Members and 1 Guest are viewing this topic.
mehdimf20
Newbie
*

Karma: 0
Offline Offline

Posts: 3


« on: February 06, 2012, 00:09:54 »

i want use this code for send email to authors of article after adding comment , where should i use this code ?

Code:
$cdd_article =& JTable::getInstance('content');
$cdd_article->load(JRequest::getInt('id'));
$cdd_authorid = $cdd_article->created_by;
$db =& JFactory::getDBO();
$query = "SELECT * FROM #__users WHERE id = " . $cdd_authorid ;
$db->setQuery($query);
$cdd_contact = $db->loadAssoc();
$cdd_email = $cdd_contact['email'];
$cdd_name = $cdd_contact['name'];

$cmm=$comment->comment;

$mailer =& JFactory::getMailer();

$config =& JFactory::getConfig();
$sender = array(
    $config->getValue( 'config.mailfrom' ),
    $config->getValue( 'config.fromname' ) );
$mailer->setSender($sender);
$recipient = $cdd_email;
 
$mailer->addRecipient($recipient);


$body   = "کاربر گرامي $cdd_name\n يک نظر جديد در مورد مطلب شما به ثبت رسيده است \n لطفا جهت بازديد از آن به سايت مراجعه کنيد\n www.tejaratekharegi.com";
$mailer->setSubject('کاربر گرامي شما يک نظر جديد دريافت کرديد');
$mailer->setBody($body);

$send =& $mailer->Send();
« Last Edit: February 06, 2012, 00:16:27 by mehdimf20 » Logged
mehdimf20
Newbie
*

Karma: 0
Offline Offline

Posts: 3


« Reply #1 on: February 28, 2012, 19:39:55 »

 Sad Sad Sad
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #2 on: February 28, 2012, 20:23:45 »

Why you do not use JComments Autosubscribe plugin?
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
tbritton
Newbie
*

Karma: 0
Offline Offline

Posts: 10


« Reply #3 on: April 16, 2012, 07:44:27 »

Hi Smart,

Great component by the way.  I am curious about your response to use the autosubscribe plugin.  I've tried it with Joomla 2.5 and it does not appear to work.  The plugin is enabled and plugins are enabled in JComments and I added a comment to an article that did not have any previous comments.

Ter
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: notification to authors of articles
 
Jump to: