<?xml version="1.0" encoding="utf-8"?>
<modification>
	<name>HTML Email</name>
	<version>1.4</version>
	<code>ocxhe14</code>
	<author>OC-Extensions.com</author>
	<link>http://www.oc-extensions.com/HTML-Email</link>

	<file path="catalog/model/account/customer.php">
		<!-- OC VERSION <= OC 2011 _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search index="0"><![CDATA[$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>
		
		<!-- OC VERSION >= OC 2020 _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search index="0"><![CDATA[$mail->setText($message);]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>		
		
		<!-- COMMON ALL VERSIONS _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[// Send to main admin email if new account email is enabled]]></search>
			<add position="before"><![CDATA[
			$mail->setHtml('');
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/model/affiliate/affiliate.php">
		<!-- OC VERSION <= OC 2011 _____________________________________________________________ -->
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search index="0,2"><![CDATA[$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>			
		
		<!-- OC VERSION >= OC 2020 _____________________________________________________________ -->
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>			
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search index="0,2"><![CDATA[$mail->setText($message);]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>			
		
		<!-- COMMON ALL VERSIONS _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[// Send to main admin email if new affiliate email is enabled]]></search>
			<add position="before"><![CDATA[
			$mail->setHtml('');
			]]></add>
		</operation>				
	</file>
	
	<file path="catalog/model/checkout/order.php">
		<!-- COMMON ALL VERSIONS _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order.tpl')) {]]></search>
			<add position="before"><![CDATA[
			$data['table_border_color'] = $this->config->get('html_email_main_table_border_color');		
			$data['table_header_bg'] = $this->config->get('html_email_main_table_header_bg');		
			$data['table_header_text_color'] = $this->config->get('html_email_main_table_header_text_color');		
			$data['table_body_bg'] = $this->config->get('html_email_main_table_body_bg');		
			$data['table_body_text_color'] = $this->config->get('html_email_main_table_body_text_color');		
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order.tpl')) {]]></search>
			<add position="replace" offset="4"><![CDATA[
			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/html_email_order.tpl')) {
				$html = $this->load->view($this->config->get('config_template') . '/template/mail/html_email_order.tpl', $data);
			} else {
				$html = $this->load->view('default/template/mail/html_email_order.tpl', $data);
			}	

			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($order_info['language_id'], $subject, $html, 'html');			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$message .= $language->get('text_update_footer');]]></search>
			<add position="after"><![CDATA[
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($order_info['language_id'], $subject, $message);
			]]></add>
		</operation>		
		
		<!-- OC VERSION <= 2.0.1.1  _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>
		
		<!-- OC VERSION >= 2.0.2.0  _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[$mail->setText($message);]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>		
	</file>
	
	<file path="catalog/model/checkout/voucher.php">
		<operation error="log">
			<search><![CDATA[if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/voucher.tpl')) {]]></search>
			<add position="replace" offset="4"><![CDATA[
			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/html_email_voucher.tpl')) {
				$html = $this->load->view($this->config->get('config_template') . '/template/mail/html_email_voucher.tpl', $data);
			} else {
				$html = $this->load->view('default/template/mail/html_email_voucher.tpl', $data);
			}		

			$this->load->model('tool/html_email');
			
			$subject = html_entity_decode(sprintf($language->get('text_subject'), $voucher['from_name']), ENT_QUOTES, 'UTF-8');
			$html = $this->model_tool_html_email->getHTMLEmail($order_info['language_id'], $subject, $html, 'html');			
			]]></add>
		</operation>
	</file>
	
	<file path="admin/model/sale/customer.php">
		<!-- OC VERSION <= OC2011 _____________________________________________________________ --> 
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_approve_subject'), $store_name), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_approve_subject'), $store_name));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search index="2"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_reward_subject'), $store_name));]]></search>
			<add  position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>		
		
		<!-- OC VERSION <= oc2020 _____________________________________________________________ --> 
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_approve_subject'), $store_name), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_approve_subject'), html_entity_decode($store_name, ENT_QUOTES, 'UTF-8')));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>		 
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>		
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_transaction_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8')));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>			
		<operation error="log">
			<search index="2"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_reward_subject'), html_entity_decode($store_name, ENT_QUOTES, 'UTF-8')));]]></search>
			<add  position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>
	</file>
	
	<file path="admin/model/marketing/affiliate.php">
		<!-- OC VERSION <= oc2011 _____________________________________________________________ --> 
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_approve_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_approve_subject'), $this->config->get('config_name')));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>		
		
		<!-- OC VERSION >= oc2020 _____________________________________________________________ --> 
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_approve_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>	
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_approve_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8')));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $message);			
			]]></add>
		</operation>		
		<operation error="log">
			<search><![CDATA[$mail->setSubject(sprintf($this->language->get('text_transaction_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8')));]]></search>
			<add position="after"><![CDATA[$mail->setHtml($html);]]></add>
		</operation>	
	</file>
	
	<file path="admin/model/sale/voucher.php">
		<!-- OC VERSION <= oc2011 _____________________________________________________________ -->
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[	
			$subject = html_entity_decode(sprintf($language->get('text_subject'), $voucher_info['from_name']), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($order_info['language_id'], $subject, $this->load->view('mail/html_email_voucher.tpl', $data), 'html');			
			]]></add>
		</operation>
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail($this->config->get('config_mail'));]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_subject'), $voucher_info['from_name']), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $this->load->view('mail/html_email_voucher.tpl', $data), 'html');			
			]]></add>
		</operation>
		
		<!-- OC VERSION >= oc2020 _____________________________________________________________ -->
		<operation error="log">
			<search index="0"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[	
			$subject = html_entity_decode(sprintf($language->get('text_subject'), $voucher_info['from_name']), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($order_info['language_id'], $subject, $this->load->view('mail/html_email_voucher.tpl', $data), 'html');			
			]]></add>
		</operation>		
		<operation error="log">
			<search index="1"><![CDATA[$mail = new Mail();]]></search>
			<add position="before"><![CDATA[
			$subject = html_entity_decode(sprintf($this->language->get('text_subject'), $voucher_info['from_name']), ENT_QUOTES, 'UTF-8');
			
			$this->load->model('tool/html_email');
			$html = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $subject, $this->load->view('mail/html_email_voucher.tpl', $data), 'html');			
			]]></add>
		</operation>	
		
		<!-- COMMON ALL VERSIONS _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[$mail->setHtml($this->load->view('mail/voucher.tpl', $data));]]></search>
			<add position="replace"><![CDATA[$mail->setHtml($html);	]]></add>
		</operation>		
	</file>
	
	<file path="admin/controller/marketing/contact.php">
	    <!-- COMMON ALL VERSIONS _____________________________________________________________ -->
		<operation error="log">
			<search><![CDATA[$message  = '<html dir="ltr" lang="en">' . "\n";]]></search>
			<add position="replace" offset="6"><![CDATA[	
			$this->load->model('tool/html_email');
			$message = $this->model_tool_html_email->getHTMLEmail($this->config->get('config_language_id'), $this->request->post['subject'], html_entity_decode($this->request->post['message'], ENT_QUOTES, 'UTF-8'), 'html');			
			]]></add>
		</operation>
	</file>
</modification>