function invite($email, array $parameters = [], array $emailParameters = [])
    {
        $email = trim(strtolower($email));

        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            throw new AuthException('Please enter a valid email address.');
        }

        // check for existing user account
        $userClass = $this->auth->getUserClass();
        $user = $userClass::where('email', $email)->first();

        // register a new temporary account
        if (!$user) {
            $parameters['email'] = $email;
            $user = $this->auth->getUserRegistration()->createTemporaryUser($parameters);
        }

        $user->sendEmail('invite', $emailParameters);

        return $user;
    }