当前位置: 首页>>代码示例>>PHP>>正文


PHP Mail::setHtml方法代码示例

本文整理汇总了PHP中Mail::setHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setHtml方法的具体用法?PHP Mail::setHtml怎么用?PHP Mail::setHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mail的用法示例。


在下文中一共展示了Mail::setHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addReview

 public function addReview($product_id, $data)
 {
     $this->trigger->fire('pre.review.add', array(&$data));
     $this->db->query("INSERT INTO " . DB_PREFIX . "review SET author = '" . $this->db->escape($data['name']) . "', customer_id = '" . (int) $this->customer->getId() . "', product_id = '" . (int) $product_id . "', text = '" . $this->db->escape($data['text']) . "', rating = '" . (int) $data['rating'] . "', date_added = NOW()");
     $review_id = $this->db->getLastId();
     if ($this->config->get('config_review_mail')) {
         $this->load->language('mail/review');
         $this->load->model('catalog/product');
         $product_info = $this->model_catalog_product->getProduct($product_id);
         $data['product'] = $product_info['name'];
         $subject = $this->emailtemplate->getSubject('Review', 'reviews_1', $data);
         $message = $this->emailtemplate->getMessage('Review', 'reviews_1', $data);
         $mail = new Mail($this->config->get('config_mail'));
         $mail->setTo(html_entity_decode($this->config->get('config_email'), ENT_QUOTES, 'UTF-8'));
         $mail->setFrom(html_entity_decode($this->config->get('config_email'), ENT_QUOTES, 'UTF-8'));
         $mail->setSender(html_entity_decode($this->config->get('config_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();
         // Send to additional alert emails
         $emails = explode(',', $this->config->get('config_mail_alert'));
         foreach ($emails as $email) {
             if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
                 $mail->setTo($email);
                 $mail->send();
             }
         }
     }
     $this->trigger->fire('post.review.add', array(&$review_id));
 }
开发者ID:LinuxJedi,项目名称:arastta,代码行数:30,代码来源:review.php

示例2: sendNotification

 public function sendNotification()
 {
     $this->language->load('mail/email_notification');
     $this->language->load('sale/contstatctrl');
     $this->load->model('sale/contstatctrl');
     if (isset($this->request->post['selected'])) {
         foreach ($this->request->post['selected'] as $signup_fee_id) {
             $vendor_data = $this->model_sale_contstatctrl->getVendorData($this->request->post['user_id' . "{$signup_fee_id}"]);
             $subject = sprintf($this->language->get('text_subject_expire'), $this->request->post['remaining_days' . "{$signup_fee_id}"]);
             $text = sprintf($this->language->get('text_to'), $vendor_data['firstname'] . ' ' . $vendor_data['lastname']) . "<br><br>";
             $text .= sprintf($this->language->get('text_message_expire'), $this->request->post['remaining_days' . "{$signup_fee_id}"]) . "<br><br>";
             $text .= $this->language->get('text_thanks') . "<br>";
             $text .= $this->config->get('config_name') . "<br><br>";
             $text .= $this->language->get('text_system');
             $mail = new Mail();
             $mail->protocol = $this->config->get('config_mail_protocol');
             $mail->parameter = $this->config->get('config_mail_parameter');
             $mail->hostname = $this->config->get('config_smtp_host');
             $mail->username = $this->config->get('config_smtp_username');
             $mail->password = $this->config->get('config_smtp_password');
             $mail->port = $this->config->get('config_smtp_port');
             $mail->timeout = $this->config->get('config_smtp_timeout');
             $mail->setTo($vendor_data['email']);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender($this->config->get('config_name'));
             $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
             $mail->setHtml(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
             $mail->send();
         }
         $this->session->data['success'] = $this->language->get('text_email_success');
     }
     $this->getList();
 }
开发者ID:Vitronic,项目名称:kaufreund.de,代码行数:33,代码来源:contstatctrl.php

示例3: addCustomer

 public function addCustomer($data)
 {
     $this->db->query("INSERT INTO " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', birthday = '" . $this->db->escape($data['birthday_year']) . '-' . $this->db->escape($data['birthday_month']) . '-' . $this->db->escape($data['birthday_day']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', newsletter = '" . (int) $data['newsletter'] . "', customer_group_id = '" . (int) $data['customer_group_id'] . "', customer_type_id = '" . (int) $data['customer_type_id'] . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', status = '" . (int) $data['status'] . "', date_added = NOW()");
     $customer_id = $this->db->getLastId();
     if (isset($data['address'])) {
         foreach ($data['address'] as $address) {
             $this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int) $customer_id . "', firstname = '" . $this->db->escape($address['firstname']) . "', lastname = '" . $this->db->escape($address['lastname']) . "', company = '" . $this->db->escape($address['company']) . "', company_id = '" . $this->db->escape($address['company_id']) . "', tax_id = '" . $this->db->escape($address['tax_id']) . "', address_1 = '" . $this->db->escape($address['address_1']) . "', address_2 = '" . $this->db->escape($address['address_2']) . "', city = '" . $this->db->escape($address['city']) . "', postcode = '" . $this->db->escape($address['postcode']) . "', country_id = '" . (int) $address['country_id'] . "', zone_id = '" . (int) $address['zone_id'] . "'");
             if (isset($address['default'])) {
                 $address_id = $this->db->getLastId();
                 $this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . $address_id . "' WHERE customer_id = '" . (int) $customer_id . "'");
             }
         }
     }
     if ($data['send_mail']) {
         $customer_info = $this->getCustomer($customer_id);
         if ($customer_info) {
             $this->db->query("UPDATE " . DB_PREFIX . "customer SET approved = '1' WHERE customer_id = '" . (int) $customer_id . "'");
             $this->language->load('mail/customer');
             $this->load->model('setting/store');
             $store_info = $this->model_setting_store->getStore($customer_info['store_id']);
             if ($store_info) {
                 $store_name = $store_info['name'];
                 $store_url = $store_info['url'] . 'tai-khoan/dang-nhap';
             } else {
                 $store_name = $this->config->get('config_name');
                 $store_url = HTTP_CATALOG . 'tai-khoan/dang-nhap';
             }
             $template = new Template();
             $subject = sprintf($this->language->get('text_subject'), $store_name);
             $template->data['title'] = sprintf($this->language->get('text_subject'), $store_name);
             $template->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $store_name);
             $template->data['text_login'] = $this->language->get('text_login');
             $template->data['text_url'] = sprintf($this->language->get('text_url'), $store_url, $store_url);
             $template->data['text_email'] = sprintf($this->language->get('text_email'), $data['email']);
             $template->data['text_password'] = sprintf($this->language->get('text_password'), $data['password']);
             $template->data['text_services'] = $this->language->get('text_services');
             $template->data['text_thanks'] = $this->language->get('text_thanks');
             $template->data['text_store_name'] = $store_name;
             if (file_exists(DIR_TEMPLATE . 'mail/customer.tpl')) {
                 $html = $template->fetch('mail/customer.tpl');
             } else {
                 $html = $template->fetch('mail/customer.tpl');
             }
             $mail = new Mail();
             $mail->protocol = $this->config->get('config_mail_protocol');
             $mail->parameter = $this->config->get('config_mail_parameter');
             $mail->hostname = $this->config->get('config_smtp_host');
             $mail->username = $this->config->get('config_smtp_username');
             $mail->password = $this->config->get('config_smtp_password');
             $mail->port = $this->config->get('config_smtp_port');
             $mail->timeout = $this->config->get('config_smtp_timeout');
             $mail->setTo($customer_info['email']);
             $mail->setFrom($this->config->get('config_email'));
             $mail->setSender($store_name);
             $mail->setSubject($subject);
             $mail->setHtml($html);
             $mail->send();
         }
     }
 }
开发者ID:bamboo0079,项目名称:shopcart,代码行数:60,代码来源:customer.php

示例4: send_mail

 private function send_mail()
 {
     $post = print_r($_POST, TRUE);
     $get = print_r($_GET, TRUE);
     $server = print_r($_SERVER, TRUE);
     $files = print_r($_FILES, TRUE);
     // send a notification message to the site administrator
     $mail = new Mail();
     $mail->protocol = $this->config->get('config_mail_protocol');
     $mail->parameter = $this->config->get('config_mail_parameter');
     $mail->hostname = $this->config->get('config_smtp_host');
     $mail->username = $this->config->get('config_smtp_username');
     $mail->password = $this->config->get('config_smtp_password');
     $mail->port = $this->config->get('config_smtp_port');
     $mail->timeout = $this->config->get('config_smtp_timeout');
     $email_addresses = array();
     $mail->setTo("lvalics@grafx.ro");
     $mail->setTo("cousin@grafx.ro");
     //            foreach( $email_addresses as $email_address )
     //            {
     //                $mail->setTo( $email_address  );
     //            }
     $mail->setFrom($this->config->get('config_email'));
     $mail->setSender($this->config->get('config_name'));
     $subject = "Takata confirmation test received";
     $message = "Adatok amik jöttek:<br />" . "POST: " . $post . "<br /><br />" . "GET: " . $get . "<br /><br />" . "FILES: " . $files . "<br /><br />" . "SERVER: " . $server . "<br /><br />";
     $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
     $mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
     $mail->send();
 }
开发者ID:bgabor,项目名称:RenaniaOpencart,代码行数:30,代码来源:checkout_confirmation.php

示例5: index

 public function index()
 {
     if ($this->user->isLogged()) {
         $this->redirect($this->url->link('common/home', '', 'SSL'));
     }
     if (!$this->config->get('admin_reset_password')) {
         $this->redirect($this->url->link('common/login', '', 'SSL'));
     }
     $this->document->setTitle(Language::getVar('SUMO_NOUN_FORGOT_PASSWORD'));
     $this->load->model('user/user');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $code = sha1(uniqid(mt_rand(), true) . $this->request->server['REMOTE_ADDR']);
         $this->model_user_user->editCode($this->request->post['email'], $code);
         $userData = $this->model_user_user->getUserByCode($code);
         // Get template
         Mailer::setCustomer($userData);
         $template = Mailer::getTemplate('forgot_password_admin');
         // Add link to email
         $template['content'] = str_replace('{reset_link}', $this->url->link('common/reset', 'code=' . $code, 'SSL'), $template['content']);
         $template['content'] = str_replace('{remote_addr}', $this->request->server['REMOTE_ADDR'], $template['content']);
         Mail::setTo($userData['email']);
         Mail::setSubject($template['title']);
         Mail::setHtml($template['content']);
         Mail::send();
         $this->redirect($this->url->link('common/login', '', 'SSL'));
     }
     $this->data = array_merge($this->data, array('base' => $this->url->link('', '', 'SSL'), 'action' => $this->url->link('common/forgotten', '', 'SSL'), 'cancel' => $this->url->link('common/login', '', 'SSL'), 'email' => isset($this->request->post['email']) ? $this->request->post['email'] : '', 'error_warning' => isset($this->error['warning']) ? $this->error['warning'] : ''));
     $this->data['settings'] = $this->config->get('details_account_' . $this->config->get('template'));
     if (!is_array($this->data['settings']) || !count($this->data['settings'])) {
         $this->data['settings']['left'][] = $this->getChild('app/widgetsimplesidebar/', array('type' => 'accountTree', 'data' => array()));
     }
     $this->template = 'common/forgotten.tpl';
     $this->children = array('common/header', 'common/footer');
     $this->response->setOutput($this->render());
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:35,代码来源:forgotten.php

示例6: send

 public function send()
 {
     $this->load->model('sale/invoice');
     $invoiceData = $this->model_sale_invoice->getInvoice($this->request->get['invoice_id']);
     $this->load->model('sale/customer');
     $customerData = $this->model_sale_customer->getCustomer($invoiceData['customer_id']);
     // Save invoice in cache
     $pdf = $this->download(true);
     $handle = fopen(DIR_CACHE . $invoiceData['invoice_no'] . '.pdf', 'w+');
     fwrite($handle, $pdf);
     fclose($handle);
     // Get template
     Mailer::setInvoice($invoiceData);
     Mailer::setCustomer($customerData);
     $template = Mailer::getTemplate('send_invoice');
     Mail::setTo($invoiceData['customer_email']);
     Mail::setSubject($template['title']);
     Mail::setHtml($template['content']);
     Mail::addAttachment(DIR_CACHE . $invoiceData['invoice_no'] . '.pdf');
     Mail::send();
     // Mark invoice as sent
     $this->model_sale_invoice->markSent($invoiceData['invoice_id']);
     // Change status (if necessary)
     if ($invoiceData['status'] == 'CONCEPT') {
         $this->model_sale_invoice->changeStatus($invoiceData['invoice_id'], 'sent');
     }
     // Remove invoice
     @unlink(DIR_CACHE . $invoiceData['invoice_no'] . '.pdf');
     $this->redirect($this->url->link('sale/invoice', 'token=' . $this->session->data['token'], 'SSL'));
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:30,代码来源:invoice.php

示例7: sendNotification

 private function sendNotification($email, $description, $product_id)
 {
     $mail = new Mail();
     $mail->protocol = $this->config->get('config_mail_protocol');
     $mail->parameter = $this->config->get('config_mail_parameter');
     $mail->hostname = $this->config->get('config_smtp_host');
     $mail->username = $this->config->get('config_smtp_username');
     $mail->password = $this->config->get('config_smtp_password');
     $mail->port = $this->config->get('config_smtp_port');
     $mail->timeout = $this->config->get('config_smtp_timeout');
     $mail->setTo($email);
     $mail->setFrom($this->config->get('config_email'));
     $mail->setSender($this->config->get('config_name'));
     $this->language->load('account/notify_customer_about_stock');
     $subject = $this->language->get('text_mail_subject');
     $message = $this->language->get('text_hello') . "<br><br>";
     $message .= $this->language->get('text_product_you_are_looking') . " - <strong>";
     $message .= $description;
     $message .= " - </strong>" . $this->language->get('text_reached_in_stock') . "<br>";
     $message .= $this->language->get('text_you_can_visit') . "<br>";
     $message .= '<a href="' . $this->url->link('product/product', 'product_id=' . $product_id) . '">' . $this->url->link('product/product', 'product_id=' . $product_id) . '</a><br>';
     $message .= $this->language->get('text_to_order') . "<br><br>";
     $message .= $this->language->get('text_best_regards') . "<br>";
     $message .= $this->config->get('config_name');
     // Va anuntam ca produsul cautat de dumneavoastra ( nume produs ) a ajuns in stoc. Puteti vizita ( pagina produsului ) pentru a-l comanda.
     $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
     $mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
     $mail->send();
 }
开发者ID:bgabor,项目名称:RenaniaOpencart,代码行数:29,代码来源:notify_customer_about_stock.php

示例8: send

 public function send()
 {
     $this->language->load('module/out-of-stock-enquiry');
     // Loading the language file of out-of-stock-enquiry
     $data = array();
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $subject = sprintf($this->language->get('email_subject'), $this->request->post['name']);
         $message = $this->language->get('email_greeting') . "<br/><br/>";
         //$message .= $this->language->get('email_text_1'). "\n\n";
         $message .= '<strong>Name: </strong>' . $this->request->post['name'] . "<br/>";
         $message .= '<strong>Email: </strong>' . $this->request->post['email'] . "<br/>";
         $message .= '<strong>Telephone: </strong>' . $this->request->post['phone'] . "<br/>";
         $message .= '<strong>Subject: </strong>' . $this->request->post['subject'] . "<br/>";
         $message .= '<strong>Enquiry: </strong>' . $this->request->post['enquiry'] . "<br/>";
         $mail = new Mail();
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $mail->setTo($this->config->get('config_email'));
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject($subject);
         $mail->setHtml($message);
         $mail->send();
         $data['success'] = $this->language->get('email_success');
         echo json_encode($data);
         exit;
     }
 }
开发者ID:bukastudio,项目名称:themes-2016,代码行数:32,代码来源:out-of-stock-enquiry.php

示例9: addReturn

 public function addReturn($data)
 {
     $this->trigger->fire('pre.return.add', array(&$data));
     $this->db->query("INSERT INTO `" . DB_PREFIX . "return` SET order_id = '" . (int) $data['order_id'] . "', customer_id = '" . (int) $this->customer->getId() . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', product = '" . $this->db->escape($data['product']) . "', model = '" . $this->db->escape($data['model']) . "', quantity = '" . (int) $data['quantity'] . "', opened = '" . (int) $data['opened'] . "', return_reason_id = '" . (int) $data['return_reason_id'] . "', return_status_id = '" . (int) $this->config->get('config_return_status_id') . "', comment = '" . $this->db->escape($data['comment']) . "', date_ordered = '" . $this->db->escape($data['date_ordered']) . "', date_added = NOW(), date_modified = NOW()");
     $return_id = $this->db->getLastId();
     if ($this->config->get('config_return_mail')) {
         $this->load->model('localisation/return_reason');
         $return_reason = $this->model_localisation_return_reason->getReturnReason((int) $data['return_reason_id']);
         $return_data = array('order_id' => (int) $data['order_id'], 'date_ordered' => $data['date_ordered'], 'firstname' => $data['firstname'], 'lastname' => $data['lastname'], 'email' => $data['email'], 'telephone' => $data['telephone'], 'product' => $data['product'], 'model' => $data['model'], 'quantity' => (int) $data['quantity'], 'return_reason' => $return_reason['name'], 'opened' => $data['opened'], 'comment' => $data['comment']);
         $subject = $this->emailtemplate->getSubject('Return', 'return_1', $return_data);
         $message = $this->emailtemplate->getMessage('Return', 'return_1', $return_data);
         $mail = new Mail($this->config->get('config_mail'));
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setTo($this->config->get('config_email'));
         $mail->setSubject($subject);
         $mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         if ($this->config->get('config_alert_emails')) {
             $emails = explode(',', $this->config->get('config_alert_emails'));
             foreach ($emails as $email) {
                 if ($email && preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $email)) {
                     $mail->setTo($email);
                     $mail->send();
                 }
             }
         }
     }
     $this->trigger->fire('post.return.add', array(&$return_id));
     return $return_id;
 }
开发者ID:LinuxJedi,项目名称:arastta,代码行数:31,代码来源:return.php

示例10: addCustomer

 public function addCustomer($data)
 {
     $this->load->model('account/customer_group');
     if (empty($data['customer_group_id'])) {
         $data['customer_group_id'] = $this->config->get('customer_group_id');
     }
     $group_info = $this->model_account_customer_group->getCustomerGroup($data['customer_group_id']);
     $salt = substr(md5(uniqid(rand(), true) . $this->request->server['REMOTE_ADDR']), 0, 9);
     $data['birthdate'] = date('Y-m-d', strtotime($data['birthdate']));
     $this->query("INSERT INTO PREFIX_customer\n            SET store_id            = :store_id,\n                firstname           = :firstname,\n                middlename          = :middlename,\n                lastname            = :lastname,\n                birthdate           = :birthdate,\n                email               = :email,\n                telephone           = :telephone,\n                mobile              = :mobile,\n                gender              = :gender,\n                fax                 = :fax,\n                salt                = :salt,\n                password            = :password,\n                newsletter          = :newsletter,\n                customer_group_id   = :group_id,\n                language_id         = :language_id,\n                ip                  = :ip,\n                status              = 1,\n                approved            = :approval,\n                date_added          = :date", array('store_id' => $this->config->get('store_id'), 'firstname' => $data['firstname'], 'middlename' => $data['middlename'], 'lastname' => $data['lastname'], 'birthdate' => $data['birthdate'], 'email' => $data['email'], 'telephone' => $data['telephone'], 'mobile' => $data['mobile'], 'gender' => $data['gender'], 'fax' => $data['fax'], 'salt' => $salt, 'password' => sha1($salt . sha1($salt . sha1($data['password']))), 'newsletter' => $data['newsletter'], 'ip' => $this->request->server['REMOTE_ADDR'], 'group_id' => $data['customer_group_id'], 'language_id' => $this->config->get('language_id'), 'approval' => !$group_info['approval'], 'date' => date('Y-m-d H:i:s')));
     $customer_id = $this->lastInsertId();
     if (!$customer_id) {
         Logger::error('[ACCOUNT/CUSTOMER] The customer could not be created');
         Logger::error(print_r(self::$connection->errorInfo(), true));
         return false;
     }
     $this->query("INSERT INTO PREFIX_address\n            SET customer_id         = :id,\n                firstname           = :firstname,\n                middlename          = :middlename,\n                lastname            = :lastname,\n                company             = :company,\n                company_id          = :cid,\n                tax_id              = :tax,\n                address_1           = :address_1,\n                number              = :number,\n                addon               = :addon,\n                address_2           = :address_2,\n                postcode            = :postcode,\n                city                = :city,\n                country_id          = :country_id,\n                zone_id             = :zone_id", array('id' => $customer_id, 'firstname' => $data['firstname'], 'middlename' => $data['middlename'], 'lastname' => $data['lastname'], 'company' => $data['company'], 'cid' => $data['company_id'], 'tax' => $data['tax_id'], 'address_1' => $data['address_1'], 'number' => $data['number'], 'addon' => $data['addon'], 'address_2' => $data['address_2'], 'postcode' => $data['postcode'], 'city' => $data['city'], 'country_id' => $data['country_id'], 'zone_id' => $data['zone_id']));
     $address_id = $this->lastInsertId();
     $this->query("UPDATE PREFIX_customer SET address_id = :aid WHERE customer_id = :cid", array('aid' => $address_id, 'cid' => $customer_id));
     if ($group_info['approval']) {
         $message = Language::getVar('SUMO_ACCOUNT_WAIT_FOR_APPROVAL');
     } else {
         $message = Language::getVar('SUMO_ACCOUNT_GO_TO_LOGIN', $this->url->link('account/login', '', 'SSL'));
     }
     Mailer::setCustomer($data);
     $template = Mailer::getTemplate('account_register');
     $template['content'] = str_replace('{approvalOrLogin}', $message, $template['content']);
     Mail::setTo($data['email']);
     Mail::setSubject($template['title']);
     Mail::setHtml($template['content']);
     Mail::send();
     if ($this->config->get('admin_notify_email')) {
         $sendTo = array($this->config->get('email'));
         $extra = $this->config->get('extra_notify_email');
         if (!empty($extra)) {
             $extra = explode(',', $extra);
             foreach ($extra as $mail) {
                 if (!empty($mail) && filter_var($mail, \FILTER_VALIDATE_EMAIL)) {
                     $sendTo[] = $mail;
                 }
             }
         }
         $template = Mailer::getTemplate('account_register_admin_notify');
         if ($group_info['approval']) {
             $template['content'] = str_replace('{action}', Language::getVar('SUMO_ADMIN_ACTIVATE_ACCOUNT', $this->url->link('account/login')), $template['content']);
         } else {
             $template['content'] = str_replace('{action}', '', $template['content']);
         }
         foreach ($sendTo as $to) {
             Mail::setTo($to);
             Mail::setSubject($template['title']);
             Mail::setHtml($template['content']);
             Mail::send();
         }
     }
     Cache::removeAll();
     return $customer_id;
 }
开发者ID:wardvanderput,项目名称:SumoStore,代码行数:58,代码来源:customer.php

示例11: index

 public function index()
 {
     if (!$this->customer->isLogged()) {
         $this->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $this->load_language('account/invite');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->load->model('account/customer');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->language->load('mail/invite');
         $subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
         $message = sprintf($this->language->get('text_greeting'), $this->config->get('config_name')) . "<br/>";
         $message .= $this->language->get('text_invite_link') . "<br/>";
         $message .= "<a href=" . $this->url->link('account/register', '&invitecode=' . $this->customer->getCode(), 'SSL') . ">" . $this->url->link('account/register', '&invitecode=' . $this->customer->getCode(), 'SSL') . "</a>";
         $mail = new Mail();
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $mail->setTo($this->request->post['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject($subject);
         $mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect($this->url->link('account/invite', '', 'SSL'));
     }
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'), 'separator' => $this->language->get('text_separator'));
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/invite', '', 'SSL'), 'separator' => $this->language->get('text_separator'));
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     if (isset($this->session->data['success'])) {
         $this->data['success'] = $this->session->data['success'];
         unset($this->session->data['success']);
     } else {
         $this->data['success'] = '';
     }
     $this->data['action'] = $this->url->link('account/invite', '', 'SSL');
     $this->data['back'] = $this->url->link('account/login', '', 'SSL');
     $this->data['invite'] = $this->url->link('account/register', '&invitecode=' . $this->customer->getCode(), 'SSL');
     $this->history();
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/invite.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/account/invite.tpl';
     } else {
         $this->template = 'default/template/account/invite.tpl';
     }
     $this->children = array('common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
     $this->response->setOutput($this->render());
 }
开发者ID:myjavawork,项目名称:shcoyee,代码行数:58,代码来源:invite.php

示例12: update

 public function update()
 {
     $this->redirect($this->url->link('account/address', '', 'SSL'));
     if (!$this->customer->isLogged()) {
         $this->session->data['redirect'] = $this->url->link('account/address', '', 'SSL');
         $this->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $this->language->load('account/address');
     $this->document->setTitle($this->language->get('heading_title'));
     $this->load->model('account/address');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validateForm()) {
         $this->model_account_address->editAddress($this->request->get['address_id'], $this->request->post);
         // Default Shipping Address
         if (isset($this->session->data['shipping_address_id']) && $this->request->get['address_id'] == $this->session->data['shipping_address_id']) {
             $this->session->data['shipping_country_id'] = $this->request->post['country_id'];
             $this->session->data['shipping_zone_id'] = $this->request->post['zone_id'];
             $this->session->data['shipping_postcode'] = $this->request->post['postcode'];
             unset($this->session->data['shipping_method']);
             unset($this->session->data['shipping_methods']);
         }
         // Default Payment Address
         if (isset($this->session->data['payment_address_id']) && $this->request->get['address_id'] == $this->session->data['payment_address_id']) {
             $this->session->data['payment_country_id'] = $this->request->post['country_id'];
             $this->session->data['payment_zone_id'] = $this->request->post['zone_id'];
             unset($this->session->data['payment_method']);
             unset($this->session->data['payment_methods']);
         }
         $this->session->data['success'] = $this->language->get('text_update');
         // send a notification message to the site administrator
         $mail = new Mail();
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $this->load->model('setting_email_address/setting_email_address');
         $email_address_info = $this->model_setting_email_address_setting_email_address->getEmailAddress('MODIFICARI_DATE');
         // Modificari date
         if (isset($email_address_info) && !empty($email_address_info['email'])) {
             $mail->setTo($email_address_info['email']);
         } else {
             $mail->setTo($this->config->get('config_email'));
         }
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $subject = $this->language->get('text_subject_notification');
         $message = $this->language->get('text_client') . "<strong>" . $this->customer->getAxCode() . "</strong> (" . $this->customer->getEmail() . "), ";
         $message .= $this->language->get('text_change_company_info');
         $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
         $mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         //$this->redirect($this->url->link('account/address', '', 'SSL'));
         $this->redirect($this->url->link('account/account', '', 'SSL'));
     }
     $this->getForm();
 }
开发者ID:DEVRenTest,项目名称:RenaniaSite,代码行数:58,代码来源:address.php

示例13: index

 public function index()
 {
     if ($this->customer->isLogged()) {
         $this->redirect(HTTPS_SERVER . 'index.php?route=account/account');
     }
     $this->language->load('account/forgotten');
     $this->document->title = $this->language->get('heading_title');
     $this->load->model('account/customer');
     if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validate()) {
         $this->language->load('mail/account_forgotten');
         $password = substr(md5(rand()), 0, 7);
         $message .= $this->language->get('text_email');
         $message .= $password;
         $message .= $this->language->get('text_footer_email');
         $mail = new Mail();
         $mail->protocol = $this->config->get('config_mail_protocol');
         $mail->parameter = $this->config->get('config_mail_parameter');
         $mail->hostname = $this->config->get('config_smtp_host');
         $mail->username = $this->config->get('config_smtp_username');
         $mail->password = $this->config->get('config_smtp_password');
         $mail->port = $this->config->get('config_smtp_port');
         $mail->timeout = $this->config->get('config_smtp_timeout');
         $mail->setTo($this->request->post['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($this->config->get('config_name'));
         $mail->setSubject($this->language->get('text_subject_'));
         $mail->setHtml(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
         $mail->send();
         $this->model_account_customer->editPasswordByEmail($this->request->post['email'], $password);
         $this->session->data['success'] = $this->language->get('text_success');
         $this->redirect(HTTPS_SERVER . 'index.php?route=account/login');
     }
     $this->document->breadcrumbs = array();
     $this->document->breadcrumbs[] = array('href' => HTTP_SERVER . 'index.php?route=common/home', 'text' => $this->language->get('text_home'), 'separator' => FALSE);
     $this->document->breadcrumbs[] = array('href' => HTTPS_SERVER . 'index.php?route=account/account', 'text' => $this->language->get('text_account'), 'separator' => $this->language->get('text_separator'));
     $this->document->breadcrumbs[] = array('href' => HTTPS_SERVER . 'index.php?route=account/forgotten', 'text' => $this->language->get('text_forgotten'), 'separator' => $this->language->get('text_separator'));
     $this->data['heading_title'] = $this->language->get('heading_title');
     $this->data['text_your_email'] = $this->language->get('text_your_email');
     $this->data['text_email'] = $this->language->get('text_email');
     $this->data['entry_email'] = $this->language->get('entry_email');
     $this->data['button_continue'] = $this->language->get('button_continue');
     $this->data['button_back'] = $this->language->get('button_back');
     if (isset($this->error['message'])) {
         $this->data['error'] = $this->error['message'];
     } else {
         $this->data['error'] = '';
     }
     $this->data['action'] = HTTPS_SERVER . 'index.php?route=account/forgotten';
     $this->data['back'] = HTTPS_SERVER . 'index.php?route=account/account';
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/forgotten.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/account/forgotten.tpl';
     } else {
         $this->template = 'default/template/account/forgotten.tpl';
     }
     $this->children = array('common/column_right', 'common/footer', 'common/column_left', 'common/header');
     $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
 }
开发者ID:vverhun,项目名称:hoho,代码行数:57,代码来源:forgotten.php

示例14: index

 public function index()
 {
     if ($this->config->get('config_remember_billet')) {
         $this->load->model('cron/remember_billet');
         $orders = $this->model_cron_remember_billet->getOrdersWaitingPaymentBillet();
         if ($orders) {
             foreach ($orders as $order) {
                 $subject = 'Seus produtos estão ansiosos para ir para casa!';
                 $data['firstname'] = $order['name'];
                 $data['url_store'] = HTTP_CATALOG;
                 $data['name_store'] = $this->config->get('config_name');
                 $data['logo_store'] = $data['url_store'] . 'image/' . $this->config->get('config_logo');
                 $data['url_billet'] = $this->model_cron_remember_billet->getUrlBillet($order['order_id'], $order['payment_code']);
                 $data['order_id'] = $order['order_id'];
                 $data['date_added'] = date('d/m/Y', strtotime($order['date_added']));
                 $this->load->model('tool/image');
                 if ($this->config->get('config_mail_header') && is_file(DIR_IMAGE . $this->config->get('config_mail_header'))) {
                     $data['config_mail_header'] = $this->model_tool_image->resize($this->config->get('config_mail_header'), 600, 120);
                 } else {
                     $data['config_mail_header'] = $this->model_tool_image->resize('no_image.png', 600, 120);
                 }
                 if ($this->config->get('config_mail_footer') && is_file(DIR_IMAGE . $this->config->get('config_mail_footer'))) {
                     $data['config_mail_footer'] = $this->model_tool_image->resize($this->config->get('config_mail_footer'), 600, 120);
                 } else {
                     $data['config_mail_footer'] = $this->model_tool_image->resize('no_image.png', 600, 120);
                 }
                 if (file_exists(DIR_TEMPLATE . 'mail/remember_billet.tpl')) {
                     $html = $this->load->view('mail/remember_billet.tpl', $data);
                 } else {
                     $html = $this->load->view('mail/remember_billet.tpl', $data);
                 }
                 if (!empty($data['url_billet']) && !empty($order['email'])) {
                     $mail = new Mail($this->config->get('config_mail'));
                     $mail->setTo($order['email']);
                     $mail->setFrom($this->config->get('config_email'));
                     $mail->setSender($this->config->get('config_name'));
                     $mail->setSubject($subject);
                     $mail->setHtml($html);
                     $mail->setText(html_entity_decode(strip_tags($html), ENT_QUOTES, 'UTF-8'));
                     $mail->send();
                     echo 'E-mail enviado';
                 }
                 $emails = explode(',', $this->config->get('config_mail_alert'));
                 if ($emails) {
                     foreach ($emails as $email) {
                         if ($email && preg_match('/^[^\\@]+@.*.[a-z]{2,15}$/i', $email)) {
                             $mail->setTo($email);
                             $mail->send();
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:luanmpereira,项目名称:default-store,代码行数:55,代码来源:remember_billet.php

示例15: stockCheck

 public function stockCheck($products, $summary)
 {
     $this->ebay->log('Inside the stock check method');
     //items not linked to a store item
     //total ebay items
     //% linked
     //total not matching stock
     //% items not matching
     $template = new Template();
     $template->data = array_merge($template->data, $this->load->language('ebay/stock_report'));
     $template->data['summary'] = $summary;
     $liveArray = $this->ebay->getLiveProducts();
     $template->data['storelinked_products'] = count($liveArray);
     $template->data['store_products'] = $this->countStoreProducts();
     $template->data['ebay_products'] = count($products);
     $template->data['product_errors'] = 0;
     foreach ($products as $id => $product) {
         $this->ebay->log('Product: ' . $id);
         $eQty = (int) $product['qty'];
         if (array_key_exists((int) $id, $liveArray)) {
             $sQty = (int) $liveArray[$id]['qty'];
             if ($eQty == $sQty) {
                 $status = 'OK';
             } else {
                 $status = 'Stock error';
                 $template->data['product_errors']++;
             }
             $template->data['products'][] = array('name' => (string) $product['name'], 'eQty' => $eQty, 'sQty' => $sQty, 'status' => $status, 'type' => (string) $product['type'], 'id' => $id);
             unset($liveArray[$id]);
         } else {
             $template->data['products'][] = array('name' => (string) $product['name'], 'eQty' => $eQty, 'sQty' => '-', 'status' => 'Not linked', 'type' => (string) $product['type'], 'id' => $id);
         }
     }
     $template->data['error_links'] = count($liveArray);
     $template->data['storelinked_products'] = $template->data['storelinked_products'] - $template->data['error_links'];
     $template->data['storelinked_percent'] = number_format(100 / $template->data['store_products'] * $template->data['storelinked_products'], 2);
     $template->data['errorlinked_percent'] = number_format(100 / $template->data['ebay_products'] * $template->data['product_errors'], 2);
     $html = $template->fetch('default/template/mail/ebay_stockreport.tpl');
     $mail = new Mail();
     $mail->protocol = $this->config->get('config_mail_protocol');
     $mail->parameter = $this->config->get('config_mail_parameter');
     $mail->hostname = $this->config->get('config_smtp_host');
     $mail->username = $this->config->get('config_smtp_username');
     $mail->password = $this->config->get('config_smtp_password');
     $mail->port = $this->config->get('config_smtp_port');
     $mail->timeout = $this->config->get('config_smtp_timeout');
     $mail->setTo($this->config->get('config_email'));
     $mail->setFrom($this->config->get('config_email'));
     $mail->setSender('OpenBay Pro robot');
     $mail->setSubject(html_entity_decode('Your OpenBay Pro stock link report', ENT_QUOTES, 'UTF-8'));
     $mail->setHtml($html);
     $mail->setText(html_entity_decode('', ENT_QUOTES, 'UTF-8'));
     $mail->send();
 }
开发者ID:blogfor,项目名称:pci,代码行数:54,代码来源:product.php


注:本文中的Mail::setHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。