當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sms::setText方法代碼示例

本文整理匯總了PHP中Sms::setText方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sms::setText方法的具體用法?PHP Sms::setText怎麽用?PHP Sms::setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sms的用法示例。


在下文中一共展示了Sms::setText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: confirm


//.........這裏部分代碼省略.........
             $text .= $result['title'] . ' ' . html_entity_decode($result['text'], ENT_NOQUOTES, 'UTF-8') . "\n";
         }
         $order_total = $result['text'];
         $text .= "\n";
         if ($order_query->row['customer_id']) {
             $text .= $language->get('text_invoice') . "\n";
             $text .= $order_query->row['store_url'] . 'index.php?route=account/invoice&order_id=' . $order_id . "\n\n";
         }
         if ($order_download_query->num_rows) {
             $text .= $language->get('text_download') . "\n";
             $text .= $order_query->row['store_url'] . 'index.php?route=account/download' . "\n\n";
         }
         if ($order_query->row['comment'] != '') {
             $comment = $order_query->row['comment'] . "\n\n" . $comment;
         }
         if ($comment) {
             $text .= $language->get('text_comment') . "\n\n";
             $text .= $comment . "\n\n";
         }
         $text .= $language->get('text_footer');
         $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($order_query->row['email']);
         $mail->setFrom($this->config->get('config_email'));
         $mail->setSender($order_query->row['store_name']);
         $mail->setSubject($subject);
         $mail->setHtml($html);
         $mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
         $mail->addAttachment(DIR_IMAGE . $this->config->get('config_logo'));
         $mail->send();
         if ($this->config->get('config_alert_mail')) {
             // HTML
             $template->data['text_greeting'] = $language->get('text_received') . "\n\n";
             $template->data['invoice'] = '';
             $template->data['text_invoice'] = '';
             if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/order_confirm.tpl')) {
                 $html = $template->fetch($this->config->get('config_template') . '/template/mail/order_confirm.tpl');
             } else {
                 $html = $template->fetch('default/template/mail/order_confirm.tpl');
             }
             $subject = sprintf($language->get('text_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id . ' (' . $order_total . ')');
             $mail->setSubject($subject);
             $mail->setTo($this->config->get('config_email'));
             $mail->setHtml($html);
             $mail->send();
             // Send to additional alert emails
             $pattern = '/^[A-Z0-9._%-+]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\\.[A-Z]{2,6}$/i';
             $emails = explode(',', $this->config->get('config_alert_emails'));
             foreach ($emails as $email) {
                 if (strlen($email) > 0 && preg_match($pattern, $email)) {
                     $mail->setTo($email);
                     $mail->send();
                 }
             }
             /*
             // Text
             $text  = $language->get('text_received') . "\n\n";
             $text .= $language->get('text_order_id') . ' ' . $order_id . "\n";
             $text .= $language->get('text_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_query->row['date_added'])) . "\n";
             $text .= $language->get('text_order_status') . ' ' . $order_status_query->row['name'] . "\n\n";
開發者ID:rb2,項目名稱:ocstoreru,代碼行數:67,代碼來源:order.php


注:本文中的Sms::setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。