示例#1
0
 public function actionEvent()
 {
     $component = new Common();
     $component->on(Common::EVENT_NOTIFY, [$component, 'notifyAdmin']);
     $component->sendMail("*****@*****.**", "Test", "Test text");
     $component->off(Common::EVENT_NOTIFY, [$component, 'notifyAdmin']);
 }
示例#2
0
 public function notification($event)
 {
     $model = User::find()->where(['roles' => 'admin'])->all();
     foreach ($model as $r) {
         Common::sendMail('Notification', 'New subscribe', $r['email']);
     }
 }
示例#3
0
 public function actionEvent()
 {
     $component = new Common();
     $component->on(Common::EVENT_NOTIFY, [$component, 'notifyAdmin']);
     $component->sendMail('*****@*****.**', 'test', 'test test test');
 }