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


PHP Sms::setPassword方法代碼示例

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


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

示例1: confirm


//.........這裏部分代碼省略.........
         $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";
             $text .= $language->get('text_product') . "\n";
             
             foreach ($order_product_query->rows as $result) {
             	$text .= $result['quantity'] . 'x ' . $result['name'] . ' (' . $result['model'] . ') ' . html_entity_decode($this->currency->format($result['total'], $order_query->row['currency'], $order_query->row['value']), ENT_NOQUOTES, 'UTF-8') . "\n";
             	$order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . $result['order_product_id'] . "'");
             	foreach ($order_option_query->rows as $option) {
             		$text .= chr(9) . '-' . $option['name'] . ' ' . $option['value'] . "\n";
             	}
             }
             
             $text .= "\n";
             
             $text.= $language->get('text_total') . "\n";
             
             foreach ($order_total_query->rows as $result) {
             	$text .= $result['title'] . ' ' . html_entity_decode($result['text'], ENT_NOQUOTES, 'UTF-8') . "\n";
             }
             
             $text .= "\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";
             }
             
             $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($order_query->row['store_name']);
             $mail->setSubject($subject);
             $mail->setText($text);
             $mail->send();
             */
         }
         if ($this->config->get('config_alert_sms')) {
             $message = str_replace(array('{ID}', '{DATE}', '{TIME}', '{SUM}'), array($order_id, date('d.m.Y'), date('H:i'), floatval($order_query->row['total'])), $this->config->get('config_sms_message'));
             $sms = new Sms($this->config->get('config_sms_gatename'));
             $sms->setTo($this->config->get('config_sms_admin_phone'));
             $sms->setText($message);
             $sms->setUsername($this->config->get('config_sms_gate_username'));
             $sms->setPassword($this->config->get('config_sms_gate_password'));
             $sms->setFrom($this->config->get('config_sms_from'));
             $sms->send();
         }
     }
 }
開發者ID:rb2,項目名稱:ocstoreru,代碼行數:101,代碼來源:order.php


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