public function notification($event) { $model = User::find()->where(['roles' => 'admin'])->all(); foreach ($model as $r) { Common::sendMail(); } }
public function actionEvent() { $component = new Common(); $component->on(Common::EVENT_NOTIFY, [$component, 'notifyAdmin']); $component->sendMail("*****@*****.**", "Test", "text text"); }