mailgun / mailgun-php

Mailgun's Official SDK for PHP
http://www.mailgun.com
MIT License
1.1k stars 314 forks source link

Mailinglist members pagination #824

Closed aisnoek closed 1 year ago

aisnoek commented 2 years ago

The response for /lists/<address>/members/pages supports pagination, the class however did not.

By added the use of the Pagination trait it's now possible to use pagination.

Usage example:

$mailgun = Mailgun::create($apiKey, $endpoint);
$mailingListMembers = $mailgun->mailingList()->member();

$response = $mailingListMembers->index($address, 1000);

while ($response && count($response->getItems()) > 0) {
    $result = [...$result, ...$response->getItems()];

    $response = $mailingListMembers->nextPage($response);
}

Additionally the readme references composer test, composer.json however no longer contained that script. Restored it accordingly.

mroeling commented 2 years ago

@Nyholm @DavidGarciaCat Any e.t.a. of an updated version with this fix please?

mroeling commented 1 year ago
ZebulanStanphill commented 1 year ago

@mroeling I'm not a maintainer of this project, so I have no clue, unfortunately.