'staff_3', 'requestData' => [ 'email' => [ 'validation' => DataValidator::email(), 'error' => ERRORS::INVALID_EMAIL ] ] ]; } public function handler() { $this->email = Controller::request('email'); $staffRow = Staff::getDataStore($this->email, 'email'); $recoverPassword = RecoverPassword::getDataStore($this->email, 'email'); if($staffRow->isNull() || $recoverPassword->isNull() || $recoverPassword->staff != 1) throw new RequestException(ERRORS::INVALID_EMAIL); $this->sendInvitationMail($staffRow, $recoverPassword->token); Response::respondSuccess(); Log::createLog('INVITE', $staffRow->name); } public function sendInvitationMail($staffRow, $token) { $mailSender = MailSender::getInstance(); $mailSender->setTemplate(MailTemplate::USER_INVITE, [ 'to' => $staffRow->email, 'name' => $staffRow->name, 'url' => Setting::getSetting('url')->getValue(), 'token' => $token ]); $mailSender->send(); } }