Post by asifshaikh » Wed Sep 26, 2018 4:45 pm

Version 2.3.0.2
I have implemented HTML in order status update email by adding summer note to designated file.
With modified following code (catalog/model/checkout/order.php) email is sending in html.

Code: Select all

if ($order_info['order_status_id'] && $order_status_id && $notify) {
				$language = new Language($order_info['language_code']);
				$language->load($order_info['language_code']);
				$language->load('mail/order');
	
				$subject = sprintf($language->get('text_update_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);
	
				$message  = $language->get('text_update_order') . ' ' . $order_id . "<br />";
				$message .= $language->get('text_update_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "<br /><br />";
	
				$order_status_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status WHERE order_status_id = '" . (int)$order_status_id . "' AND language_id = '" . (int)$order_info['language_id'] . "'");
	
				if ($order_status_query->num_rows) {
					$message .= $language->get('text_update_order_status') . "<br /><br />";
					$message .= $order_status_query->row['name'] . "<br /><br />";
				}

				if ($order_info['customer_id']) {
					$message .= $language->get('text_update_link') . "<br />";
					$message .= $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id . "<br /><br />";
				}
	
				if ($comment) {
					$message .= $language->get('text_update_comment') . "<br /><br />";
					$message .= $comment . "<br /><br />";
				}
	
				$message .= $language->get('text_update_footer');
	
				$mail = new Mail();
				$mail->protocol = $this->config->get('config_mail_protocol');
				$mail->parameter = $this->config->get('config_mail_parameter');
				$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
				$mail->smtp_username = $this->config->get('config_mail_smtp_username');
				$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
				$mail->smtp_port = $this->config->get('config_mail_smtp_port');
				$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
	
				$mail->setTo($order_info['email']);
				$mail->setFrom($this->config->get('config_email'));
				$mail->setSender(html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
				$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
				$mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
				$mail->send();
But this $message .= $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id . "<br /><br />"; code rendering as plain text. it is not generating the link.

Plz. suggest

Newbie

Posts

Joined
Sat Sep 08, 2012 9:36 pm

Post by straightlight » Wed Sep 26, 2018 6:06 pm

$message variable in this case is used for text email purposes only. Not for HTML outputs.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by asifshaikh » Wed Sep 26, 2018 7:36 pm

So, what I need to change to make it Html?

Newbie

Posts

Joined
Sat Sep 08, 2012 9:36 pm
Who is online

Users browsing this forum: No registered users and 34 guests