mailjet / mailjet-gem

[API v3] Mailjet official Ruby GEM

Home Page:https://dev.mailjet.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Listrecipient.all(limit:0) misleading

Uepsilon opened this issue · comments

commented

According to the documentation the param limit: 0 should return ALL recipients but returns only 1000.

also, when using limit: 0, offset is not working.

irb(main):033:0> Mailjet::Listrecipient.all(list_id: XYZ, limit: 0).count
=> 1000
irb(main):034:0> Mailjet::Listrecipient.all(list_id: XYZ, limit: 0, offset: 1000).count
=> 1000

irb(main):035:0> Mailjet::Listrecipient.all(list_id: XYZ, limit: 1000).count
=> 1000
irb(main):036:0> Mailjet::Listrecipient.all(list_id: XYZ, limit: 1000, offset: 1000).count
=> 174

The documentation is updated. .all returns up to 1000 entries, not all. https://github.com/mailjet/mailjet-gem#retrieve-all-objects