diff --git a/composer.json b/composer.json index 6ce917a..aa06e6d 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["convertkit", "api", "forms"], "require": { "php": ">=5.5", - "guzzlehttp/guzzle": "^6.3", + "guzzlehttp/guzzle": "^6.5|^7.0", "monolog/monolog": "^2.0" }, "require-dev": { @@ -20,4 +20,4 @@ }, "minimum-stability": "dev", "prefer-stable": true -} \ No newline at end of file +} diff --git a/src/ConvertKit_API.php b/src/ConvertKit_API.php index c49a29e..4818ff4 100644 --- a/src/ConvertKit_API.php +++ b/src/ConvertKit_API.php @@ -348,7 +348,7 @@ public function get_subscriber_id( $email_address ) { $options = array( 'api_secret' => $this->api_secret, - 'status' => 'all', + 'email_address' => $email_address, ); $this->create_log(sprintf("GET subscriber id from all subscribers: %s, %s, %s", $request, json_encode($options), $email_address)); @@ -366,27 +366,7 @@ public function get_subscriber_id( $email_address ) { return $subscriber_id; } - $total_pages = $subscribers->total_pages; - - $this->create_log(sprintf("Total number of pages is %s", $total_pages)); - - for ( $i = 2; $i <= $total_pages; $i++ ) { - $options['page'] = $i; - $this->create_log(sprintf("Go to page %s", $i)); - $subscribers = $this->make_request( $request, 'GET', $options ); - - if( !$subscribers ) { - return false; - } - - $subscriber_id = $this::check_if_subscriber_in_array($email_address, $subscribers->subscribers); - - if($subscriber_id) { - return $subscriber_id; - } - } - - $this->create_log("Subscriber not found anywhere"); + $this->create_log("Subscriber not found"); return false;