本文整理汇总了PHP中Sms::setTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Sms::setTo方法的具体用法?PHP Sms::setTo怎么用?PHP Sms::setTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sms
的用法示例。
在下文中一共展示了Sms::setTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confirm
//.........这里部分代码省略.........
}
}
$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";
}
$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();
}
}
/*