VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: flaterik on June 29, 2012, 15:00:07 PM

Title: Notification on customer review
Post by: flaterik on June 29, 2012, 15:00:07 PM
Hi people, i notice that after a customer review, no mail was sended to shop administrator.
Is possibile to receive email on every review?

Thanks
Title: Re: Notification on customer review
Post by: Maggy29 on July 06, 2012, 18:26:26 PM
I ran into an older post where a fix was applied for the same problem in VM 1.1.8 http://forum.virtuemart.net/index.php?topic=82660.0) (http://forum.virtuemart.net/index.php?topic=82660.0)).
Maybe a same sort of fix should be applied in components/com_virtuemart/controllers/productdetails.php?

I'm trying to solve the same problem.
Title: Re: Notification on customer review
Post by: alatak on July 07, 2012, 11:38:39 AM
Hello

QuoteHi people, i notice that after a customer review, no mail was sended to shop administrator.
Is possibile to receive email on every review?
Yes you are rigth it is a good idea.
Title: Re: Notification on customer review
Post by: Maggy29 on July 16, 2012, 12:00:33 PM
Well, I think the change should be made in administrator/components/com_virtuemart/models/ratings.php.

The next problem I run into is that I can't find the Virtuemart/Joomla function to send the actual mail. Anyone?
Title: Re: Notification on customer review
Post by: Maggy29 on July 19, 2012, 21:40:34 PM
Well, this is the code I included in administrator/components/com_virtuemart/models/ratings.php, after
$reviewTable = $this->getTable('rating_reviews');
      $reviewTable->bindChecknStore($data,true);


insert:
$mail_subject = "Product Review Notification";
$mail_body = "A customer just posted a review on one product. Go to " .$mosConfig_sitename. " > Components > VirtueMart > Produits > Customer Reviews to edit it or to moderate it,\n";
$mail_body .= "or if you are already logged in the back end, you can read it here: \n";
$mail_body .= $mosConfig_live_site. "/administrator/administrator/index.php?option=com_virtuemart&view=ratings";
$mail_body = html_entity_decode( $mail_body );

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

$mailer->setSender($sender);
$recipient = $sender[0];

$mailer->addRecipient($recipient);
$mailer->setSubject($mail_subject);
$mailer->setBody($mail_body);

$send =& $mailer->Send();
if ( $send !== true ) {
    echo 'Error sending email: ' . $send->message;
} else {
    echo 'Mail sent';
}


Remark: the sender and recipient are both the same: the administrator.
Title: Re: Notification on customer review
Post by: warningdang on December 09, 2012, 21:22:43 PM
Quote from: Maggy29 on July 19, 2012, 21:40:34 PM
Well, this is the code I included in administrator/components/com_virtuemart/models/ratings.php, after
$reviewTable = $this->getTable('rating_reviews');
      $reviewTable->bindChecknStore($data,true);


insert:
$mail_subject = "Product Review Notification";
$mail_body = "A customer just posted a review on one product. Go to " .$mosConfig_sitename. " > Components > VirtueMart > Produits > Customer Reviews to edit it or to moderate it,\n";
$mail_body .= "or if you are already logged in the back end, you can read it here: \n";
$mail_body .= $mosConfig_live_site. "/administrator/administrator/index.php?option=com_virtuemart&view=ratings";
$mail_body = html_entity_decode( $mail_body );

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

$mailer->setSender($sender);
$recipient = $sender[0];

$mailer->addRecipient($recipient);
$mailer->setSubject($mail_subject);
$mailer->setBody($mail_body);

$send =& $mailer->Send();
if ( $send !== true ) {
    echo 'Error sending email: ' . $send->message;
} else {
    echo 'Mail sent';
}


Remark: the sender and recipient are both the same: the administrator.

Worked for me with Virtuemart 2.0.8d

Thanks for this solution
Title: Re: Notification on customer review
Post by: 4est on March 07, 2013, 10:13:45 AM
thanks, I just implemented this on vm2.0.18a, hope it works
Title: Re: Notification on customer review
Post by: 4est on March 07, 2013, 10:25:53 AM
It does not appear to work on vm 2.0.18a
I get no errors when I add the review, but no email either
Title: Re: Notification on customer review
Post by: m.davide82 on May 04, 2013, 09:46:34 AM
It works but how can I insert the name and the link of the product inside?
Title: Re: Notification on customer review
Post by: m.davide82 on May 16, 2013, 11:12:15 AM
Any news? Nobody can help me?
Title: Re: Notification on customer review
Post by: lindapowers on December 04, 2013, 12:02:45 PM
Oops just found there was another topic about an issue I just posted.

Was this ever developed or included in VM2? cause im not getting any e-mail in 2.024C

Regards