Problem/Motivation

A customer has currently over 50 lists and we tried to select a list in the commerce checkout, but could not find the correct one.
We found the limiting factor in brevo/src/ContactsApiClientHelper.php on line 175 as the default limit is set to 10:

ContactsApi::getLists(
    int $limit = '10',
    int $offset = '0',
    string $sort = 'desc'
):

This patch changes this limit to 50 as it looks like the API is not working with more. Just a quick fix.

CommentFileSizeAuthor
brevo-get-lists-limit-50.patch474 bytesmathiasgmeiner

Issue fork brevo-3583452

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mathiasgmeiner created an issue. See original summary.

kensae made their first commit to this issue’s fork.

kensae’s picture

Since the Brevo API caps list returns at 50 per request, I suggest adding a configurable limit parameter to the fetchAvailableLists function. This should default to 0 (representing no limit). If the requested limit exceeds 50—or is set to 0—the function should automatically handle pagination using the offset parameter to retrieve the full set of results.

kensae’s picture

Status: Active » Needs review
renrhaf’s picture

Status: Needs review » Fixed

Merged into 1.0.x, Thanks @kensae for the contribution!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.