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


PHP Emails::model方法代碼示例

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


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

示例1: beforeAction

 public function beforeAction($action)
 {
     if (!parent::beforeAction($action)) {
         return false;
     }
     if (isset(Yii::app()->user->usIdent)) {
         // Obtiene la clasificación de los equipos
         $clasificacion = Clasificacion::model()->with('equipos')->findAll(array('order' => 'posicion ASC'));
         Yii::app()->setParams(array('clasificacion' => $clasificacion));
         // Obtiene la información del usuario
         $usuario = Usuarios::model()->with('recursos')->findByPK(Yii::app()->user->usIdent);
         Yii::app()->setParams(array('usuario' => $usuario));
         // Obtiene la información de la mensajeria
         //Saca la lista de los emails recibidos por el usuario y que ademas no los haya leido
         $mensajeria = Emails::model()->findAllByAttributes(array('id_usuario_to' => Yii::app()->user->usIdent, 'leido' => 0));
         $countmens = count($mensajeria);
         Yii::app()->setParams(array('countmens' => $countmens));
         // Obtiene la información de las notificaciones
         //Saca la lista de las notinicaciones recibidas por el usuario y que ademas no haya leido
         $notificaciones = Usrnotif::model()->findAllByAttributes(array('usuarios_id_usuario' => Yii::app()->user->usIdent, 'leido' => 0));
         $countnot = count($notificaciones);
         Yii::app()->setParams(array('countnot' => $countnot));
     }
     Yii::app()->setParams(array('bgclass' => 'bg-estadio-fuera'));
     return true;
 }
開發者ID:rMarinf,項目名稱:JugadorNum12,代碼行數:26,代碼來源:Controller.php

示例2: actionBackgroundProcess

 /**
  * 
  * @return String generated time
  */
 public function actionBackgroundProcess()
 {
     $gentime = microtime();
     $gentime = explode(' ', $gentime);
     $gentime = $gentime[1] + $gentime[0];
     $pg_start = $gentime;
     // verify if are emails pending to send
     $emails = Emails::model()->findAll(array('condition' => 't.email_status = 0', 'limit' => Yii::app()->params['mailSendMultiples']));
     if (count($emails) > 0) {
         foreach ($emails as $email) {
             Yii::import('application.extensions.phpMailer.yiiPhpMailer');
             $mailer = new yiiPhpMailer();
             if ($mailer->Ready($email->email_subject, $email->email_body, array('email' => $email->email_toMail, 'name' => $email->email_toName), $email->email_priority)) {
                 $email->email_status = 1;
                 $email->email_sentDate = date("Y-m-d G:i:s");
                 $email->save(false);
             }
         }
     }
     $gentime = microtime();
     $gentime = explode(' ', $gentime);
     $gentime = $gentime[1] + $gentime[0];
     $pg_end = $gentime;
     $totaltime = $pg_end - $pg_start;
     $showtime = number_format($totaltime, 4, '.', '');
     echo "Generacion en " . $showtime . " segundos";
 }
開發者ID:lanzelotik,項目名稱:celestic-community,代碼行數:31,代碼來源:SiteController.php

示例3: loadUpdateEmail

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  */
 public function loadUpdateEmail()
 {
     if ($this->_model === null) {
         if (isset($_POST['ContactForm']['email'])) {
             $condition = "email='" . $_POST['ContactForm']['email'] . "'";
             $this->_model = Emails::model()->find($condition);
         }
         if ($this->_model === null) {
             $this->_model = new Emails();
         }
     }
     return $this->_model;
 }
開發者ID:edii,項目名稱:testYii,代碼行數:17,代碼來源:SiteController.php

示例4: actionPendingMails

 public function actionPendingMails()
 {
     // verify if are emails pending to send
     $emails = Emails::model()->findAll(array('condition' => 't.email_status = 0', 'limit' => Yii::app()->params['mailSendMultiples']));
     if (count($emails) > 0) {
         foreach ($emails as $email) {
             Yii::import('application.extensions.phpMailer.yiiPhpMailer');
             $mailer = new yiiPhpMailer();
             if ($mailer->Ready($email->email_subject, $email->email_body, array('email' => $email->email_toMail, 'name' => $email->email_toName), $email->email_priority)) {
                 $email->email_status = 1;
                 $email->email_sentDate = date("Y-m-d G:i:s");
                 $email->save(false);
             }
         }
     }
 }
開發者ID:lanzelotik,項目名稱:celestic-community,代碼行數:16,代碼來源:BackgroundCommand.php

示例5: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Emails the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Emails::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
開發者ID:ronwar76,項目名稱:PassPort,代碼行數:15,代碼來源:EmailsController.php

示例6: send_deffered_emails

 public function send_deffered_emails()
 {
     $emails = Emails::model()->sending_round(self::EMAILS_COUNT)->findAll();
     foreach ($emails as $email) {
         if ($email->send()) {
             $email->delete();
         }
     }
 }
開發者ID:akoch-ov,項目名稱:dipstart-development,代碼行數:9,代碼來源:EventsCommand.php

示例7: actionSendPendingEmails

 /**
  * Send pending emails
  * Execute all minutes
  * identificator 5 
  */
 public function actionSendPendingEmails()
 {
     $controlCronJobId = 5;
     //Check control job
     $control = ControlCronjobs::model()->findByPk($controlCronJobId);
     //Check if status is 0 for to execute
     if ($control->status == 0) {
         $control->status = 1;
         if ($control->save()) {
             //Search all pending emails
             $emails = Emails::model()->findAll('status = :status', array(':status' => Emails::STATUS_PENDING));
             if (count($emails)) {
                 foreach ($emails as $email) {
                     if (Yii::app()->email->send('noreply@campeonatojustasmedievales.com', $email->destination, $email->title, $email->body, array($email->headers))) {
                         $email->status = Emails::STATUS_SENDED;
                         Yii::trace('[CRONJOBS][actionSendPendingEmails] email enviado.');
                     } else {
                         $email->status = Emails::STATUS_ERROR;
                         Yii::trace('[CRONJOBS][actionSendPendingEmails] No se puede enviar el email.', 'error');
                     }
                     $email->date = date('Y-m-d H:i:s');
                     if (!$email->save()) {
                         Yii::trace('[CRONJOBS][actionSendPendingEmails] No se puede actualizar el email a enviado', 'error');
                     }
                 }
             }
             //Free job
             $control->status = 0;
             if (!$control->save()) {
                 Yii::trace('[CRONJOBS][actionSendPendingEmails] No se ha podido salvar el control de proceso una vez finalizado.', 'warning');
             }
         } else {
             Yii::trace('[CRONJOBS][actionSendPendingEmails] No se ha podido salvar el control de proceso.', 'warning');
         }
     } else {
         Yii::trace('[CRONJOBS][actionSendPendingEmails] Hay otra ejecución en proceso.', 'warning');
     }
 }
開發者ID:RubenDjOn,項目名稱:medieval-jousting-tournaments,代碼行數:43,代碼來源:CronJobController.php

示例8: actionSendEmails

 public function actionSendEmails()
 {
     $emails = Emails::model()->findAll();
     foreach($emails as $email) {
         $this->sendMail($email->email);
     }
 }
開發者ID:Vladimirtishenko,項目名稱:garmata.tv,代碼行數:7,代碼來源:AjaxController.php


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