api_client_creds = $api_client_creds; $this->set_path( 'api/v2/jobs/verification-email' ) ->send_client_id(); } /** * Set body data, make the API call, and handle the response. * * @param string|null $user_id - Auth0 user ID to send the verify email to. * * @return bool|mixed|null */ public function call( $user_id = null ) { if ( empty( $user_id ) ) { return self::RETURN_ON_FAILURE; } if ( ! $this->set_bearer( self::API_SCOPE ) ) { return self::RETURN_ON_FAILURE; } return $this->add_body( 'user_id', $user_id ) ->post() ->handle_response( __METHOD__ ); } /** * Handle API response. * * @param string $method - Method that called the API. * * @return mixed|null */ protected function handle_response( $method ) { if ( $this->handle_wp_error( $method ) ) { return self::RETURN_ON_FAILURE; } if ( $this->handle_failed_response( $method, 201 ) ) { return self::RETURN_ON_FAILURE; } return true; } }