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

Incorrect example documentation for Events? #379

Closed
zacharytyhacz opened this issue Aug 9, 2023 · 2 comments · Fixed by #381
Closed

Incorrect example documentation for Events? #379

zacharytyhacz opened this issue Aug 9, 2023 · 2 comments · Fixed by #381

Comments

@zacharytyhacz
Copy link
Contributor

zacharytyhacz commented Aug 9, 2023

I just want to get failed email events. The examples and documentation for this package is a little misleading.

I was reading these docs about the events API

It says that it accepts a query as second parameter mg.events.get(domain, query), but the example shows second parameter as an object of options:
image

The official Mailgun documentation show more query options:
https://documentation.mailgun.com/en/latest/api-events.html#filter-field
image

@olexandr-mazepa
Copy link
Collaborator

Hi @zacharytyhacz
Thank you for highlighting this.
For some reason this readme section wasn't finished, I will update it shortly.
Till that time I can confirm that second parameter should be an object and you can use next types to see expected/allowed properties:

export type FilterField = {
event?: string;
list?: string;
attachment?: string;
from?: string;
'message-id'?: string;
subject?: string;
to?: string;
size?: string;
recipient?: string;
recipients?: string;
tags?: string;
severity?: string;
}
export type EventsQuery = FilterField & {
page?: string;
begin?: string;
end?: string;
ascending?: 'yes'| 'no';
limit?: number;
}

@zacharytyhacz
Copy link
Contributor Author

@olexandr-mazepa 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

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

Successfully merging a pull request may close this issue.

2 participants