public function actionSendSms() { if (empty($_POST['id'])) { $errors['id'] = 'Поле email должно быть заполнено'; } if (empty($_POST['text'])) { $errors['text'] = 'Поле email должно быть заполнено'; } if (!empty($errors)) { $this->sendResponse(self::STATUS_BAD_REQUEST, $errors); } if (CmsUser::sendSms($_POST['text'], $_POST['id'])) { $this->sendResponse(self::STATUS_OK, "email отправлен"); } else { $this->sendResponse(self::STATUS_INTERNAL_SERVER_ERROR, "email не отправлен"); } }
public function actionAxjaxMail() { if (isset($_POST['text'])) { return CmsUser::sendSms($_POST['text'], $_POST['id']); } }