public function actionSend()
 {
     //BaseMailer::useFileTransport = false;
     $modelEmail = Email::find()->all();
     //vd($modelEmail);
     foreach ($modelEmail as $email) {
         Yii::$app->mailer->compose(['html' => '@common/mail/letter'], ['name' => 'Sir.Kotmonstr', 'imageFileName' => 'https://lh3.ggpht.com/wml38uiBjuXJqWbMnA20hubEXTrdavS-MJcDoeV7hCYnL9-m2A9KmAfhVtgsp8CZsEA=w300'])->setFrom('*****@*****.**')->setTo($email->email)->setSubject('Firs test email by Admin')->send();
     }
     return $this->redirect('/email/index');
 }
 public function actionSend()
 {
     //BaseMailer::useFileTransport = false;
     $modelEmail = Email::find()->all();
     //vd($modelEmail);
     foreach ($modelEmail as $email) {
         Yii::$app->mailer->compose(['html' => '@common/mail/letter'], ['name' => 'Sir.Kotmonstr', 'imageFileName' => Yii::getAlias('@frontend') . '/web/img/1.jpg'])->setFrom('*****@*****.**')->setTo($email->email)->setSubject('Firs test email by Kostya')->send();
     }
     return $this->redirect('/email/index');
 }
Exemple #3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Email::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'email', $this->email]);
     return $dataProvider;
 }
Exemple #4
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Email::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['email_id' => $this->email_id, 'email_scholar_id' => $this->email_scholar_id]);
     $query->andFilterWhere(['like', 'subject', $this->subject])->andFilterWhere(['like', 'content', $this->content]);
     return $dataProvider;
 }