Jump to content

Send e-mail to shop admin for moderation after comment submitted


rob84

Recommended Posts

Hello. I'm trying to understand how can an e-mail sent to shop owner when someone write a comment on a product, using the default PS comment/review module. I tried to add in productcomments.php after line 540 in about:

$comment->save();

this code:

$template_name = 'approvazione_commento';  
$title = "New comment to approve"; 
$to = "[email protected]";
$toName = "To name";
$from = "[email protected]";
$fromName = "From Name";

Mail::Send($template_name, $title, $to, $toName, $from, $fromName);

But no mail is sent. How should be work ?

Thanks.

Link to comment
Share on other sites

Where is the template file located? Did you add a txt file along with the html one?

 

I'd try adding dummy parameters till the $die one, set to true, so it dies with an error on failure:

 

 

public static function Send($id_lang, $template, $subject, $template_vars, $to,
$to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
$template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null)
Link to comment
Share on other sites

 

Where is the template file located? Did you add a txt file along with the html one?

 

/mails/it/approvazione_commento.html (and .txt)

 

Do I have to substitute this code:

Mail::Send($template_name, $title, $to, $toName, $from, $fromName);

with yours ?

public static function Send($id_lang, $template, $subject, $template_vars, $to,
$to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
$template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null)

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...