Hi. I have version 1.5.1.3 I supply documents to customers and some times I have to email them a scanned copy, Is it possible to have an add attachment facility to the comment box in order history notify customer just like in a normal email.
Thanks,
tonyforty.
Just use what is already available in the mail class by adding this line to your function:
That will just add your store logo as an attachment for example.
However, you may not want to attach something so you won't always want to call this. You'll want to set it up as a conditional, starting with the image/file upload as the attachment.
Hypothetical Code: (taken from your addHistory function)
Code: Select all
$mail->addAttachment(HTTP_IMAGE . $this->config->get('config_logo'));
However, you may not want to attach something so you won't always want to call this. You'll want to set it up as a conditional, starting with the image/file upload as the attachment.
Hypothetical Code: (taken from your addHistory function)
Code: Select all
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($order_info['email']);
$mail->setFrom($this->config->get('config_email'));
//PERFORM CHECK HERE
if ($data['attachment']) {
$mail->addAttachment(HTTP_IMAGE . $this->config->get('config_logo'));
}
//END CHECK
$mail->setSender($order_info['store_name']);
$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
Who is online
Users browsing this forum: No registered users and 1 guest