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


PHP messages::sendEMail方法代码示例

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


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

示例1: process

 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     $affiliateIds = array($this->getRequestVar('affiliateid', array(1, 4, 7)));
     $data = array('emailText' => '', 'mailSubject' => '');
     if (is_null($affiliateIds[0])) {
         $this->redirect('affiliate/list');
     }
     if (!is_null($this->getRequestVar('mailData'))) {
         $data = array_merge($data, $this->getRequestVar('mailData'));
         if (strpos($data['mailRecipients'], PHP_EOL) == false) {
             str_replace(PHP_EOL, ';', $data['mailRecipients']);
         }
         $recipients = explode(';', $data['mailRecipients']);
         $sendRecipients = array();
         $affiliateList = new \model\affiliate_list($this->dbconnection);
         foreach ($affiliateList->getAffiliateIdsByEmail($recipients) as $affiliateIdArr) {
             $affiliate = new \model\affiliate($this->getDbconnection(), $affiliateIdArr['id']);
             $category = new \model\category($this->getDbconnection(), $affiliate->getAffiliateCategory());
             $replacers = array('pagename' => $affiliate->getPageName(), 'pageurl' => $affiliate->getPageUrl(), 'adminname' => $affiliate->getPageAdminName(), 'adminmail' => $affiliate->getPageAdminEmail(), 'category' => $category->getName());
             $mailtext = $data['emailText'];
             foreach ($replacers as $key => $value) {
                 $mailtext = str_replace('{{' . $key . '}}', $value, $mailtext);
             }
             $mailData = array('mailTo' => $affiliate->getPageAdminEmail(), 'mailSubject' => $this->filterRequest($data['mailSubject'], array(1, 4, 7, 2)), 'mailText' => $this->filterRequest($mailtext, array(1, 4, 7, 2)), 'mailFrom' => 'affiliat_r_no_reply@' . $_SERVER['HTTP_HOST']);
             \messages::sendEMail($mailData);
             $sendRecipients[] = $affiliate->getPageAdminEmail();
         }
         $mailtext = $data['emailText'];
         foreach ($replacers as $key => $value) {
             $mailtext = str_replace('{{' . $key . '}}', '', $mailtext);
         }
         foreach ($recipients as $recipient) {
             if (in_array($recipient, $sendRecipients)) {
                 continue;
             }
             $mailData = array('mailTo' => $recipient, 'mailSubject' => $this->filterRequest($data['mailSubject'], array(1, 4, 7, 2)), 'mailText' => $this->filterRequest($mailtext, array(1, 4, 7, 2)), 'mailFrom' => 'affiliat_r_no_reply@' . $_SERVER['HTTP_HOST']);
             \messages::sendEMail($mailData);
         }
         $this->redirect('affiliate/list');
     } else {
         $affiliate = new \model\affiliate($this->getDbconnection(), $affiliateIds[0]);
         $recipients = array($affiliate->getPageAdminEmail());
     }
     $data['recipients'] = implode(';', $recipients);
     $view = new \model\view_acp('contact');
     foreach ($data as $key => $value) {
         $view->assign($key, $value);
     }
     $view->render();
 }
开发者ID:sea75300,项目名称:affiliat_r,代码行数:53,代码来源:contact.php

示例2: process

 public function process()
 {
     $affiliate = new \model\affiliate($this->getDbconnection());
     if (!is_null($this->getRequestVar('submsave')) && !is_null($this->getRequestVar('antiSpamAnswer'))) {
         if ($this->getRequestVar('antiSpamAnswer') === $this->getSysconfig()->getAntispamAnswer()) {
             $data = $this->getRequestVar('affiliate');
             foreach ($data as $key => $value) {
                 $data[$key] = $this->filterRequest($value, array(1, 4, 7));
             }
             $affiliate->setPageName($data['pageName']);
             $affiliate->setPageUrl($data['pageUrl']);
             $affiliate->setPageAdminName($data['pageAdminName']);
             $affiliate->setPageAdminEmail($data['pageAdminEmail']);
             $affiliate->setPageButton($data['pageButton']);
             $affiliate->setAffiliateCategory($data['affiliateCategory']);
             $affiliate->setAffiliateAddedTime(time());
             $affiliate->setAffiliateEditedTime(0);
             $affiliate->setAffiliateIsMarked(0);
             $affiliate->setAffiliateIsAccpted(0);
             if ($affiliate->save()) {
                 \messages::registerNotice(\language::returnLanguageConstant('APPLY_OK'));
                 $catgory = new \model\category($this->dbconnection, $affiliate->getAffiliateCategory());
                 $mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_SUBJECT'), array('{{affiliateKategory}}' => $catgory->getName())), 'mailText' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_TEXT'), array('{{name}}' => $affiliate->getPageAdminName(), '{{page}}' => $affiliate->getPageUrl(), '{{affiliateKategory}}' => $catgory->getName(), '{{acpLink}}' => \base_config::$rootPath)), 'mailFrom' => $affiliate->getPageAdminEmail());
                 \messages::sendEMail($mailData);
             } else {
                 \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED'));
             }
             $affiliate = new \model\affiliate($this->getDbconnection());
         } else {
             \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED_SPAM'));
         }
     }
     $categoryList = new \model\category_list($this->getDbconnection(), false);
     $categories = array();
     foreach ($categoryList->getCategories() as $category) {
         $categories[$category->getName()] = $category->getId();
     }
     $view = new \model\view_public('apply_form');
     $view->assign('affiliate', $affiliate);
     $view->assign('categories', $categories);
     $view->assign('antiSpamQuestion', $this->getSysconfig()->getAntispamQuestion());
     $view->assign('isNotUtf8', $this->isNotUtf8);
     $view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
     $view->setReturnRender($this->returnRender);
     if ($this->returnRender) {
         $data = $view->render();
         return $data;
     }
     $view->render();
 }
开发者ID:sea75300,项目名称:affiliat_r,代码行数:50,代码来源:apply.php

示例3: process

 public function process()
 {
     if (!is_null($this->getRequestVar('nologin'))) {
         \messages::registerError(\language::returnLanguageConstant('NO_LOGIN'));
     }
     if (!is_null($this->getRequestVar('nopassreset'))) {
         \messages::registerError(\language::returnLanguageConstant('LOGIN_PASSWORD_RESET_FAILED'));
     }
     if (!is_null($this->getRequestVar('resetpass'))) {
         $newPass = uniqid();
         $mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::returnLanguageConstant('LOGIN_PASSWORD_RESET'), 'mailText' => $newPass, 'mailFrom' => 'affiliat_r_no_reply@' . $_SERVER['HTTP_HOST']);
         if (\messages::sendEMail($mailData)) {
             $this->getSysconfig()->setLoginPasswort($newPass);
             $this->getSysconfig()->update();
             $this->redirect();
         } else {
             $this->redirect('', array('nopassreset'));
         }
     }
     $sessionCookieValue = $this->getSessionCookieValue();
     if (!is_null($sessionCookieValue)) {
         $session = new \model\session($this->getDbconnection(), $sessionCookieValue);
         if ($session->exists()) {
             $this->redirect('system/dash');
         }
     }
     if (!is_null($this->getRequestVar('passwd', array(1, 4, 7)))) {
         $passwort = \tools::createPasswordHash($this->getRequestVar('passwd'), $this->getSysconfig()->getLoginPasswortSalt());
         if ($passwort == $this->getSysconfig()->getLoginPasswort()) {
             $ip = $_SERVER["REMOTE_ADDR"];
             $sessionId = sha1(uniqid($ip, true));
             $expire = time() + $this->getSysconfig()->getSessionLength();
             $session = new \model\session($this->getDbconnection());
             $session->setLogin(time());
             $session->setLogout(0);
             $session->setSessionId($sessionId);
             $session->setIp($ip);
             $session->save();
             setcookie('afltrsid', $sessionId, $expire, '/', $_SERVER["SERVER_NAME"], false, true);
             $this->redirect('system/dash');
         }
         \messages::registerError(\language::returnLanguageConstant('WRONG_PASSWORD'));
     }
     $view = new \model\view_acp('login');
     $view->assign('defaultPW', '');
     $view->render();
 }
开发者ID:sea75300,项目名称:affiliat_r,代码行数:47,代码来源:login.php


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