Beispiel #1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $this->hasPrivilege(Acl::ACTION_CREATE);
     $this->pageTitle = 'Send' . ' ' . $this->resourceLabel;
     $model = new EmailQueue(EmailQueue::SCENARIO_MASS_EMAIL);
     $model->sent_by = Yii::app()->user->id;
     $model->from_name = Yii::app()->settings->get(Constants::CATEGORY_GENERAL, Constants::KEY_COMPANY_NAME, 'xchnge');
     $model->from_email = Yii::app()->settings->get(Constants::CATEGORY_GENERAL, Constants::KEY_ADMIN_EMAIL, '*****@*****.**');
     $model_class_name = $model->getClassName();
     if (isset($_POST[$model_class_name])) {
         $model->attributes = $_POST[$model_class_name];
         if ($model->validate()) {
             Yii::app()->user->setFlash('success', Lang::t('Email successfully queued for sending.'));
             $this->refresh();
         }
     }
     $this->render('create', array('model' => $model));
 }