Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->load->model('checkout/success');
- $data['products'] = array();
- $data['products'] = $this->model_checkout_success->getProducts($order_id);
- unset($mail);
- $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');
- foreach ($data['products'] as $product) {
- $data['text_greeting'] = $this->language->get('text_greeting');
- $mail->setTo($product['email']);
- $mail->setFrom($this->config->get('config_email'));
- $mail->setSender(html_entity_decode('testing sender', ENT_QUOTES, 'UTF-8'));
- $mail->setSubject(html_entity_decode('testing', ENT_QUOTES, 'UTF-8'));
- $mail->setHtml($this->load->view('mail/checkout', $data));
- $mail->send();
- }
- public function getProducts($order_id) {
- $this->language->load('checkout/success');
- $query = $this->db->query("SELECT DISTINCT u.email as email, u.shopname, u.user_id, o.order_id,
- CONCAT(oi.invoice_prefix_no,oi.invoice_order_no) as invoice FROM " . DB_PREFIX . "order o LEFT JOIN
- " . DB_PREFIX . "order_product op ON (op.order_id = o.order_id) LEFT JOIN " . DB_PREFIX . "user u ON
- (u.user_id = op.user_id) LEFT JOIN order_invoice oi ON (oi.order_id = o.order_id AND oi.user_id = u.user_id)
- WHERE o.order_id = '" . (int)$order_id . "'");
- return $query->rows;
- }
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Order</title>
- </head>
- <body style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;">
- <div style="width: 680px;">
- <p style="font-size:13px; margin-top: 0px; margin-bottom: 20px;"><?php echo $text_greeting; ?></p>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement