Skip to content

Commit

Permalink
finished updating the mail system
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Apr 6, 2015
1 parent 04b1742 commit 56ef27d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion upload/admin/model/sale/voucher.php
Expand Up @@ -128,7 +128,7 @@ public function sendVoucher($voucher_id) {
$mail->setTo($voucher_info['to_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(sprintf($language->get('text_subject'), $voucher_info['from_name']), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(sprintf($language->get('text_subject'), html_entity_decode($voucher_info['from_name'], ENT_QUOTES, 'UTF-8')));
$mail->setHtml($this->load->view('mail/voucher.tpl', $data));
$mail->send();

Expand Down
8 changes: 4 additions & 4 deletions upload/catalog/model/checkout/order.php
Expand Up @@ -410,14 +410,14 @@ public function addOrderHistory($order_id, $order_status_id, $comment = '', $not
$order_status = '';
}

$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
$subject = sprintf($language->get('text_new_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);

// HTML Mail
$data = array();

$data['title'] = sprintf($language->get('text_new_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);
$data['title'] = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);

$data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
$data['text_greeting'] = sprintf($language->get('text_new_greeting'), $order_info['store_name']);
$data['text_link'] = $language->get('text_new_link');
$data['text_download'] = $language->get('text_new_download');
$data['text_order_detail'] = $language->get('text_new_order_detail');
Expand All @@ -440,7 +440,7 @@ public function addOrderHistory($order_id, $order_status_id, $comment = '', $not
$data['text_footer'] = $language->get('text_new_footer');

$data['logo'] = $this->config->get('config_url') . 'image/' . $this->config->get('config_logo');
$data['store_name'] = html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8');
$data['store_name'] = $order_info['store_name'];
$data['store_url'] = $order_info['store_url'];
$data['customer_id'] = $order_info['customer_id'];
$data['link'] = $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id;
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/model/checkout/voucher.php
Expand Up @@ -102,7 +102,7 @@ public function confirm($order_id) {
$data['image'] = '';
}

$data['store_name'] = html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8');
$data['store_name'] = $order_info['store_name'];
$data['store_url'] = $order_info['store_url'];
$data['message'] = nl2br($voucher['message']);

Expand Down
12 changes: 6 additions & 6 deletions upload/catalog/model/openbay/ebay_order.php
Expand Up @@ -281,20 +281,19 @@ public function confirm($order_id, $order_status_id, $comment = '') {

$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'] . "'");

$order_status = '';
if ($order_status_query->num_rows) {
$order_status = $order_status_query->row['name'];
} else {
$order_status = '';
}

$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
$subject = sprintf($language->get('text_new_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);

// HTML Mail
$data = array();

$data['title'] = sprintf($language->get('text_new_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);
$data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));
$data['title'] = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
$data['text_greeting'] = sprintf($language->get('text_new_greeting'), $order_info['store_name']);
$data['text_link'] = $language->get('text_new_link');
$data['text_download'] = $language->get('text_new_download');
$data['text_order_detail'] = $language->get('text_new_order_detail');
Expand Down Expand Up @@ -323,7 +322,7 @@ public function confirm($order_id, $order_status_id, $comment = '') {
}

$data['logo'] = HTTPS_SERVER . 'image/' . $this->config->get('config_logo');
$data['store_name'] = html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8');
$data['store_name'] = $order_info['store_name'];
$data['store_url'] = $order_info['store_url'];
$data['customer_id'] = $order_info['customer_id'];
$data['link'] = $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id;
Expand All @@ -340,6 +339,7 @@ public function confirm($order_id, $order_status_id, $comment = '') {
$data['order_status'] = $order_status;

$data['comment'] = '';

if ($comment && $notify) {
$data['comment'] = nl2br($comment);
}
Expand Down Expand Up @@ -519,7 +519,7 @@ public function confirm($order_id, $order_status_id, $comment = '') {
$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->setSubject($subject);
$mail->setHtml($html);
$mail->setText($text);
$mail->send();
Expand Down

1 comment on commit 56ef27d

@gsc1ugs
Copy link

@gsc1ugs gsc1ugs commented on 56ef27d Apr 7, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of them - it was in mail.php line 156 protocol=='Mail' its case sensitive should be 'mail'

Please sign in to comment.