public static function queueDispatch() { $mails = MailQueue::find()->where(['=', 'success', 0])->andWhere(['<', 'attempts', 4])->all(); //var_dump($mails) ; foreach ($mails as $mail) { MailQueue::sendMail($mail); } return true; }
public function actionResend() { $id = \Yii::$app->request->post("id"); if ($id) { // \Yii::trace(\Yii::$app->request->post("id")); $model = MailQueue::findOne($id); MailQueue::sendMail($model); } return null; }