当前位置: 首页>>代码示例>>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;未经允许,请勿转载。