I\'m running Opencart Version 2.0.1.1. I need a way of editing the layout of the registration and order update email.
By this, I mean control the full
i had same problem but i used mailgun lib to send my mails and i can use html/css templates :)
if you like follow this steps: 1-download mailgun lib https://github.com/mailgun/mailgun-php
2- you have to edit system mail system or add your function to opencart system : (i change mail function opencart totaly) i add this codes to /system/library/mail.php rename send() to oldsend() or whatever you want
//extracted mailgun lib address
require 'mailgun/autoload.php';
use Mailgun\Mailgun;
public function send(){
$mg = new Mailgun("mailgunkey goeshere");
$domain = "your domain code";
$mg->sendMessage($domain, array(
'from' => $this->from ,
'to' => $this->to ,
'subject' => $this->subject ,
'text' => $this->text ,
'html' => $this->html
));
}
as a example for sending mail:
$data['text_discount'] = 'text';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/welcome.tpl')) {
$html = $this->load->view($this->config->get('config_template') . '/template/mail/welcome.tpl', $data);
} else {
$html = $this->load->view('default/template/mail/welcome.tpl', $data);
}
$mail->setTo($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender(html_entity_decode($this->config->get('config_name'),ENT_QUOTES, 'UTF-8'));
$mail->setSubject($subject);
$mail->setHtml($html);
$mail->send();
this is just basic example :)