/**
  * Creates a new Subscribers model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Subscribers();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['index', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
 /**
  * Creates a new Subscribers model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Subscribers();
     if (isset($_GET['message'])) {
         $message = $_GET['message'];
     } else {
         $message = '';
     }
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $emailtempaltemodel = EmailTemplates::find()->where(['email_key' => $model->type])->multilingual()->one();
         $admin_email = Configurations::find()->where(['key' => 'admin_email'])->one();
         Yii::$app->mailer->compose('subscribers-html', ['model' => $model, 'emailtempaltemodel' => $emailtempaltemodel])->setFrom($admin_email->value)->setTo($model->email)->setCc($admin_email->value)->setSubject($emailtempaltemodel->subject)->send();
         return $this->redirect(['create', 'message' => 'you are subscribed now']);
     } else {
         return $this->render('create', ['model' => $model, 'message' => $message]);
     }
 }