'staff_3', 'requestData' => [ 'template' => [ 'validation' => DataValidator::notBlank()->length(LengthConfig::MIN_LENGTH_TEMPLATE), 'error' => ERRORS::INVALID_TEMPLATE ], 'language' => [ 'validation' => DataValidator::oneOf(DataValidator::in(Language::getSupportedLanguages()), DataValidator::nullType()), 'error' => ERRORS::INVALID_LANGUAGE ], ] ]; } public function handler() { $type = Controller::request('template'); $language = Controller::request('language'); $mailTemplate = MailTemplate::findOne(' language = ? AND template = ?', [$language, $type]); if($mailTemplate->isNull()) { throw new RequestException(ERRORS::INVALID_TEMPLATE); } Response::respondSuccess($mailTemplate->toArray()); } }