Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model/GetEmailCampaigns count is wrong #38

Closed
karsten-eger opened this issue Apr 9, 2018 · 4 comments
Closed

Model/GetEmailCampaigns count is wrong #38

karsten-eger opened this issue Apr 9, 2018 · 4 comments

Comments

@karsten-eger
Copy link

The count value in the Model/GetEmailCampaigns model is wrong when you use the optional filtering (by i.e. status). In our example the array with campaigns contained the correct campaigns regarding the used filter but count was always the amount of campaigns available without any filtering.

see

public function getEmailCampaigns($type = null, $status = null, $limit = '500', $offset = '0')

@ekta-slit
Copy link
Collaborator

Hi @karsten-eger

The count field in response will always be the total number of Email campaigns present in the account, irrespective of the filter used. Same is the case with rest all GET calls.

Thanks

@karsten-eger
Copy link
Author

This does not make any sense though. How am I supposed to do a paging when I have no idea how many entities the result is holding? I thought that's what "count" is for 😉

@ekta-slit
Copy link
Collaborator

For paging you can use campaigns field in response which is an array of objects ( count on that, you already have limit and offset query parameters ) and along with that we give complete count of campaigns as well 🙂

@karsten-eger
Copy link
Author

or paging you can use campaigns field in response which is an array of objects ( count on that, you already have limit and offset query parameters )
Let's do an example here:

  • I have 200 campaigns in my account (55 are sent)
  • I want to create a paged view with 10 (sent) campaigns on each page

With what you suggest I have no way of knowing I need 6 pages for this since the only options I have is count the entries in campaigns which is 10 - the limit I'm setting or use the count field, which is 200 in this case. How am I supposed to get the count of the sent campaigns (55)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants