I need to send two mails when adding an order history, this action have the option to notify the customer about the status of its order. Every time I approve an order I have to inform the customer, So...
In that action I need to send an extra email to a specific address. I tried to duplicate this action in:
Code: Select all
public/catalog/controller/mail/order.php
Code: Select all
//Test second mail
$secondmail = new Mail($this->config->get('config_mail_engine'));
$secondmail->parameter = $this->config->get('config_mail_parameter');
$secondmail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$secondmail->smtp_username = $this->config->get('config_mail_smtp_username');
$secondmail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$secondmail->smtp_port = $this->config->get('config_mail_smtp_port');
$secondmail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mymail="test@mail.com";
$secondmail->setTo($mymail);
$secondmail->setFrom($from);
$secondmail->setSender(html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
$secondmail->setSubject(html_entity_decode(sprintf($language->get('text_subject'), $order_info['store_name'], $order_info['order_id']), ENT_QUOTES, 'UTF-8'));
$secondmail->setText($this->load->view('mail/order_edit', $data));
$secondmail->send();
$mail->send();