本文整理汇总了PHP中Mail::setSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setSubject方法的具体用法?PHP Mail::setSubject怎么用?PHP Mail::setSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::setSubject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCustomer
public function addCustomer($data)
{
if (isset($data['customer_group_id']) && is_array($this->config->get('config_customer_group_display')) && in_array($data['customer_group_id'], $this->config->get('config_customer_group_display'))) {
$customer_group_id = $data['customer_group_id'];
} else {
$customer_group_id = $this->config->get('config_customer_group_id');
}
$this->load->model('account/customer_group');
$customer_group_info = $this->model_account_customer_group->getCustomerGroup($customer_group_id);
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET store_id = '" . (int) $this->config->get('config_store_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', newsletter = '" . (isset($data['newsletter']) ? (int) $data['newsletter'] : 0) . "', customer_group_id = '" . (int) $customer_group_id . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', status = '1', approved = '" . (int) (!$customer_group_info['approval']) . "', date_added = NOW()");
$customer_id = $this->db->getLastId();
$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int) $customer_id . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int) $data['country_id'] . "', zone_id = '" . (int) $data['zone_id'] . "'");
$address_id = $this->db->getLastId();
$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int) $address_id . "' WHERE customer_id = '" . (int) $customer_id . "'");
$this->load->language('mail/customer');
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
if (!$customer_group_info['approval']) {
$message .= $this->language->get('text_login') . "\n";
} else {
$message .= $this->language->get('text_approval') . "\n";
}
$message .= $this->url->link('account/login', '', 'SSL') . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->config->get('config_name');
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to main admin email if new account email is enabled
if ($this->config->get('config_account_mail')) {
$message = $this->language->get('text_signup') . "\n\n";
$message .= $this->language->get('text_website') . ' ' . $this->config->get('config_name') . "\n";
$message .= $this->language->get('text_firstname') . ' ' . $data['firstname'] . "\n";
$message .= $this->language->get('text_lastname') . ' ' . $data['lastname'] . "\n";
$message .= $this->language->get('text_customer_group') . ' ' . $customer_group_info['name'] . "\n";
if ($data['company']) {
$message .= $this->language->get('text_company') . ' ' . $data['company'] . "\n";
}
$message .= $this->language->get('text_email') . ' ' . $data['email'] . "\n";
$message .= $this->language->get('text_telephone') . ' ' . $data['telephone'] . "\n";
$mail->setTo($this->config->get('config_email'));
$mail->setSubject(html_entity_decode($this->language->get('text_new_customer'), ENT_QUOTES, 'UTF-8'));
$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
$mail->send();
// Send to additional alert emails if new account email is enabled
$emails = explode(',', $this->config->get('config_mail_alert'));
foreach ($emails as $email) {
if (utf8_strlen($email) > 0 && preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $email)) {
$mail->setTo($email);
$mail->send();
}
}
}
return $customer_id;
}
示例2: subscribes
public function subscribes($data)
{
$res = $this->db->query("select * from " . DB_PREFIX . "newsletter where news_email='" . $data['email'] . "'");
if ($res->num_rows == 1) {
return "Email Already Exist";
} else {
if ($this->db->query("INSERT INTO " . DB_PREFIX . "newsletter(news_email) values ('" . $data['email'] . "')")) {
//$this->response->redirect($this->url->link('common/home', '', 'SSL'));
$this->load->language('module/newsletter');
$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');
$mail->setTo($data['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender(html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject(sprintf($this->language->get('email_subject')));
$mail->setText(sprintf($this->language->get('email_content')));
$mail->send();
return "Subscription Successfull";
} else {
//$this->response->redirect($this->url->link('common/home', '', 'SSL'));
return "Subscription Fail";
}
}
}
示例3: addComment
public function addComment($blog_id, $data)
{
$this->event->trigger('pre.comment.add', $data);
$this->db->query("INSERT INTO " . DB_PREFIX . "comment SET commenter = '" . $this->db->escape($data['commenter']) . "', customer_id = '" . (int) $this->customer->getId() . "', blog_id = '" . (int) $blog_id . "', text = '" . $this->db->escape($data['text']) . "', date_added = NOW()");
$comment_id = $this->db->getLastId();
if ($this->config->get('config_blog_comment_mail')) {
$this->load->language('mail/comment');
$this->load->model('blog/blog');
$blog_info = $this->model_blog_blog->getblog($blog_id);
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = $this->language->get('text_waiting') . "\n";
$message .= sprintf($this->language->get('text_blog'), $this->db->escape(strip_tags($blog_info['name']))) . "\n";
$message .= sprintf($this->language->get('text_commenter'), $this->db->escape(strip_tags($data['commenter']))) . "\n";
$message .= $this->language->get('text_comment') . "\n";
$message .= $this->db->escape(strip_tags($data['text'])) . "\n\n";
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo(array($this->config->get('config_email')));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setText(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->event->trigger('post.comment.add', $comment_id);
}
示例4: _sendNotification
/**
* Send notification to admin if need
* @param $fromCheckPointTime
* @return bool
*/
private function _sendNotification($fromCheckPointTime)
{
if (!Yii::app()->params['csb']['notifyAdmin'] || empty(Yii::app()->params['csb']['adminEmail'])) {
return;
}
// send log of blocked users for last period
$lockedUsers = CsbLog::model()->findAll('create_time > :createTime AND type = :type', array(':createTime' => $fromCheckPointTime, ':type' => CsbLog::TYPE_LOCK));
if (!$lockedUsers) {
$this->_verbose("There's no new locked IPs");
return false;
}
$notification = 'Some users were blocked. Check Time ' . date('Y-m-d H:i:s') . '<br /><br />
<table cellpadding="5px" cellspacing="5px">
<tr>
<th>IP</th>
<th>Block Time</th>
<th>Block Till Time</th>
<th>User</th>
<th>Details</th>
</tr>';
foreach ($lockedUsers as $row) {
$notification .= '<tr>
<td>' . long2ip($row->ip) . '</td>
<td>' . $row->create_time . '</td>
<td>' . $row->till_time . '</td>
<td>' . $row->user_id . '</td>
<td>' . $row->details . '</td>
</tr>';
}
$notification .= '</table>';
$mail = new Mail();
$mail->setSubject('Some users were blocked')->setBodyHtml($notification)->addTo(Yii::app()->params['csb']['adminEmail'])->send();
$this->_verbose("Email was sent to admin", null, self::VERBOSE_INFO);
}
示例5: validate
public function validate()
{
$this->language->load('module/ULTIMATUMcontactform');
$json = array();
if (strlen($this->request->post['ULTIMATUMcontactform_email']) > 96 || !preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $this->request->post['ULTIMATUMcontactform_email'])) {
$json['error']['warning'] = $this->language->get('error_email');
} elseif (strlen($this->request->post['ULTIMATUMcontactform_message']) < 3) {
$json['error']['warning'] = $this->language->get('error_message');
}
if ($this->config->get('ULTIMATUMcontactform_captcha')) {
if ($this->request->post['captcha'] != $this->session->data['captcha']) {
$json['error']['warning'] = $this->language->get('error_captcha');
}
}
if (!$json) {
$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->request->post['ULTIMATUMcontactform_email']);
$mail->setSender($this->request->post['ULTIMATUMcontactform_email']);
$mail->setSubject(html_entity_decode($this->language->get('email_subject'), ENT_QUOTES, 'UTF-8'));
$mail->setText(strip_tags(html_entity_decode($this->request->post['ULTIMATUMcontactform_message'], ENT_QUOTES, 'UTF-8')));
$mail->send();
$json['success'] = $this->language->get('success');
}
$this->response->setOutput(json_encode($json));
}
示例6: addAskquestion
public function addAskquestion($product_id, $data)
{
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product_id);
$subject = sprintf($this->language->get('text_subject_e_ask'), html_entity_decode($data['name1'], ENT_QUOTES, 'UTF-8'), html_entity_decode($product_info['name'], ENT_QUOTES, 'UTF-8'));
$message = sprintf($this->language->get('text_product_e_ask'), html_entity_decode($product_info['name'], ENT_QUOTES, 'UTF-8')) . "\n";
$message .= sprintf($this->language->get('text_url_e_ask'), html_entity_decode($this->url->link('product/product', '&product_id=' . $this->db->escape(html_entity_decode($product_info['product_id']))))) . "\n\n";
$message .= sprintf($this->language->get('text_name_e_ask'), html_entity_decode($data['name1'], ENT_QUOTES, 'UTF-8')) . "\n";
$message .= sprintf($this->language->get('text_email_e_ask'), html_entity_decode($data['email1'], ENT_QUOTES, 'UTF-8')) . "\n\n\n";
$message .= $this->language->get('text_question_e_ask') . "\n\n";
$message .= html_entity_decode($data['text1'], ENT_QUOTES, 'UTF-8') . "\n\n";
$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');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom(html_entity_decode($data['email1']));
$mail->setSender(html_entity_decode($data['name1'], ENT_QUOTES, 'UTF-8'));
$mail->setSubject($subject);
$mail->setText($message);
$mail->send();
$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();
}
}
}
示例7: addAffiliate
public function addAffiliate($data)
{
$this->getDb()->query("\r\n\t\t\tINSERT INTO affiliate \r\n\t\t\t(firstname, lastname, email, telephone, fax, password, company, address_1, address_2, city, postcode, country_id, \r\n\t\t\tzone_id, code, commission, tax, payment, cheque, paypal, bank_name, bank_branch_number, bank_swift_code, bank_account_name,\r\n\t\t\tbank_account_number, status, approved, date_added)\r\n\t\t\tVALUES (\r\n\t\t\t\t:firstName, :lastName, :email, :phone, :fax, :password, :company, :address1, :address2, :city, :zip, \r\n\t\t\t\t:countryId, :zoneId, :code, :commission, :tax, :payment, :cheque, :paypal, :bankName, :bankBranchNumber, \r\n\t\t\t\t:bankSwiftCode, :bankAccountName, :bankAccountNumber, 1, 1, NOW()\r\n\t\t\t)\r\n\t\t\t", [":firstName" => $data['firstname'], ":lastName" => $data['lastname'], ":email" => $data['email'], ":phone" => $data['telephone'], ":fax" => $data['fax'], ":password" => md5($data['password']), ":company" => $data['company'], ":address1" => $data['address_1'], ":address2" => $data['address_2'], ":city" => $data['city'], ":zip" => $data['postcode'], ":countryId" => $data['country_id'], ":zoneId" => $data['zone_id'], ":code" => uniqid(), ":commission" => $this->config->get('config_commission'), ":tax" => $data['tax'], ":payment" => $data['payment'], ":cheque" => $data['cheque'], ":paypal" => $data['paypal'], ":bankName" => $data['bank_name'], ":bankBranchNumber" => $data['bank_branch_number'], ":bankSwiftCode" => $data['bank_swift_code'], ":bankAccountName" => $data['bank_account_name'], ":bankAccountNumber" => $data['bank_account_number']]);
$this->language->load('mail/affiliate');
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_welcome'), $this->config->get('config_name')) . "\n\n";
$message .= $this->language->get('text_approval') . "\n";
$message .= $this->url->link('affiliate/login', '', 'SSL') . "\n\n";
$message .= $this->language->get('text_services') . "\n\n";
$message .= $this->language->get('text_thanks') . "\n";
$message .= $this->config->get('config_name');
$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->setText($message);
$mail->send();
}
示例8: 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;
}
示例9: 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());
}
示例10: 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'));
}
示例11: index
public function index()
{
$data['email'] = isset($this->request->post['email']) ? $this->request->post['email'] : ($this->auth->isLogged() ? $this->auth->getEmail() : false);
$data['subject'] = isset($this->request->post['subject']) ? $this->request->post['subject'] : false;
$data['message'] = isset($this->request->post['message']) ? $this->request->post['message'] : false;
if ('POST' == $this->request->getRequestMethod() && $this->_validatePost()) {
$mail = new Mail();
$mail->setTo(MAIL_INFO);
$mail->setFrom(MAIL_FROM);
$mail->setReplyTo($this->request->post['email']);
$mail->setSender(MAIL_SENDER);
$mail->setSubject($this->request->post['subject']);
$mail->setText($this->request->post['message']);
$mail->send();
$this->session->setUserMessage(array('success' => tt('Your message was sent successfully!')));
$data['subject'] = false;
$data['message'] = false;
}
$this->document->setTitle(tt('Contact Us'));
$data['module_breadcrumbs'] = $this->load->controller('module/breadcrumbs', array(array('name' => tt('Home'), 'href' => $this->url->link('common/home'), 'active' => false), array('name' => tt('Contact Us'), 'href' => $this->url->link('common/contact', '', 'SSL'), 'active' => true)));
$data['error'] = $this->_error;
$data['href_common_information_licenses'] = $this->url->link('common/information/licenses');
$data['href_common_information_terms'] = $this->url->link('common/information/terms');
$data['href_common_information_faq'] = $this->url->link('common/information/faq');
$data['action'] = $this->url->link('common/contact', '', 'SSL');
$data['alert_success'] = $this->load->controller('common/alert/success');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');
$this->response->setOutput($this->load->view('common/contact.tpl', $data));
}
示例12: 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();
}
示例13: sendPassFormSubmitted
public function sendPassFormSubmitted($form)
{
$values = $form->getValues();
$user = $this->model->findByEmail($values['email']);
if (!$user->id) {
// $this->flashMessage('Účet so zadaným e-mailom neexistuje', self::FLASH_MESSAGE_ERROR);
$this->flashMessage('Provided email does not exist in the system', self::FLASH_MESSAGE_ERROR);
$this->redirect('this');
} else {
$token = $this->model->allowTemporaryLogin($user->id, $values['email'], $this->tempLoginTokenExpiration);
// send email with url for temporary login
try {
$email_template = $this->createTemplate();
$email_template->setFile(__DIR__ . '/../templates/email.phtml');
$email_template->completeName = $user->completeName;
$email_template->tempLoginUri = $this->link('//tempLogin', array('tempLoginToken' => $token));
$mail = new Mail();
$mail->setFrom(Environment::getConfig("contact")->forgottenPassEmail);
$mail->addTo($values['email']);
$mail->setSubject('Password Assistance');
$mail->setHtmlBody($email_template);
$mail->send();
} catch (DibiDriverException $e) {
$this->flashMessage(OPERATION_FAILED, self::FLASH_MESSAGE_ERROR);
$this->redirect('this');
} catch (InvalidStateException $e) {
// $this->flashMessage('Email sa nepodarilo odoslať, skúste znova o pár sekúnd', self::FLASH_MESSAGE_ERROR);
$this->flashMessage('Email could NOT be sent. Please try again in a moment', self::FLASH_MESSAGE_ERROR);
$this->redirect('this');
}
// $this->flashMessage('Na zadaný e-mail boli odoslané prihlasovacie údaje', self::FLASH_MESSAGE_SUCCESS);
$this->flashMessage('E-mail with detailed information has been sent to ' . $values['email'], self::FLASH_MESSAGE_SUCCESS);
$this->redirect('this');
}
}
示例14: index
public function index()
{
if ($this->customer->isLogged()) {
$this->redirect($this->url->link('account/account', '', 'SSL'));
}
$this->language->load('account/forgotten');
$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/forgotten');
$password = substr(sha1(uniqid(mt_rand(), true)), 0, 10);
// $password = substr(md5(uniqid(mt_rand(), true)), 0, 10);
// $password = "1212";
$this->model_account_customer->editPasswordOs($this->request->post['email'], $password);
$subject = sprintf($this->language->get('text_subject'), $this->config->get('config_name'));
$message = sprintf($this->language->get('text_greeting'), $this->config->get('config_name')) . "\n\n";
$message .= $this->language->get('text_password') . "\n\n";
$message .= $password;
$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(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
$mail->setText(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/forgotten', '', '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('text_forgotten'), 'href' => $this->url->link('account/forgotten', '', 'SSL'), '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['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
$this->data['action'] = $this->url->link('account/forgotten', '', 'SSL');
$this->data['back'] = $this->url->link('account/login', '', 'SSL');
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_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header');
$this->response->setOutput($this->render());
}
示例15: editOrder
public function editOrder($order_id, $data)
{
$this->db->query("UPDATE `" . DB_PREFIX . "order` SET order_status_id = '" . (int) $data['order_status_id'] . "', date_modified = NOW() WHERE order_id = '" . (int) $order_id . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int) $order_id . "', order_status_id = '" . (int) $data['order_status_id'] . "', notify = '" . (isset($data['notify']) ? (int) $data['notify'] : 0) . "', comment = '" . $this->db->escape(strip_tags($data['comment'])) . "', date_added = NOW()");
if (isset($data['notify'])) {
$query = $this->db->query("SELECT *, os.name AS status, l.code AS language FROM `" . DB_PREFIX . "order` o LEFT JOIN " . DB_PREFIX . "order_status os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) LEFT JOIN " . DB_PREFIX . "language l ON (o.language_id = l.language_id) WHERE o.order_id = '" . (int) $order_id . "'");
if ($query->num_rows) {
$language = new Language($query->row['language']);
$language->load('customer/order');
$subject = sprintf($language->get('mail_subject'), html_entity_decode($this->config->get('config_store'), ENT_QUOTES, 'UTF-8'), $order_id);
$message = $language->get('mail_order') . ' ' . $order_id . "\n";
$message .= $language->get('mail_date_added') . ' ' . date($language->get('date_format_short'), strtotime($query->row['date_added'])) . "\n\n";
$message .= $language->get('mail_order_status') . "\n\n";
$message .= $query->row['status'] . "\n\n";
$message .= $language->get('mail_invoice') . "\n";
$message .= html_entity_decode(HTTP_CATALOG . 'index.php?route=account/invoice&order_id=' . $order_id, ENT_QUOTES, 'UTF-8') . "\n\n";
if (isset($data['comment'])) {
$message .= $language->get('mail_comment') . "\n\n";
$message .= strip_tags(html_entity_decode($data['comment'], ENT_QUOTES, 'UTF-8')) . "\n\n";
}
$message .= $language->get('mail_footer');
$mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password'), ENT_QUOTES, 'UTF-8'), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
$mail->setTo($query->row['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender(html_entity_decode($this->config->get('config_store'), ENT_QUOTES, 'UTF-8'));
$mail->setSubject($subject);
$mail->setText($message);
$mail->send();
}
}
}