1

I have tried to create a file in override/classes named Mail.php and use the code below. I am trying to BCC all emails that are sent from the system to me - I basically want to see if emails are outgoing since some customers complain they don't get emails from us.

We're using Prestashop 1.5.0 and SMTP emails. I tried changing modesmtp from null to true but it didn't work neither.

I am testing this on my own order and would expect to receive email twice - normal one and bcced one. I get only the one.

 <?php
class Mail extends MailCore
{
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)
{
// send to customer
$ret = parent::Send($id_lang, $template, $subject, $template_vars, $to, $to_name, $from, $from_name, $file_attachment, $mode_smtp, $template_path, $die, $id_shop);

// send to shop owner
parent::Send($id_lang, $template, $subject, $template_vars, "my@email.com -  I really put MY email here no worries", $to_name, $from, $from_name, $file_attachment, $mode_smtp, $template_path, $die, $id_shop);

return $ret;
}
}

?>
Skuta
  • 5,830
  • 27
  • 60
  • 68
  • My temporary solution is edited classes/Mail.php and line of code $to_list->addBcc("myemail@myemail.com","Administrator"); I do not like to override these emails and I wish I knew how to do this properly :-) – Skuta Jul 05 '14 at 08:39
  • Did you remove `cache/class_index.php` to clear the cache after you added the override? – yenshirak Jul 08 '14 at 15:11
  • No, I only flushed cache from advanced settings and performance tab – Skuta Jul 09 '14 at 06:39
  • In PrestaShop 1.5.6.2 that clears the autoload cache as well, but perhaps you should check `class_index.php` to make sure that the override is applied. – yenshirak Jul 09 '14 at 08:17

0 Answers0