private function pushToMailQueue($subject, $message, $mailids = null){ $return = false; try{ if(empty($subject) || empty($message)){ return; } if(!isset($mailids) || empty($mailids)){ $mailids = $this->admin_mail; } $attributes = array( "mailids" => $mailids, "subject" => $subject, "mail_body" => $message ); $data = \Mailqueue::create($attributes); $isOk = \applib\EmailClass::SendMail($mailids, $this->send_mail_from, $subject, $message); $return = true; } catch (\Slim\Exception $ex) { $err = $ex; } catch (\Exception $ex) { $err = $ex; } return $return; }
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model=Mailqueue::model()->findByPk($id); if($model===null) throw new CHttpException(404,'The requested page does not exist.'); return $model; }