mailgun / mailgun.js

Javascript SDK for Mailgun
https://www.npmjs.com/package/mailgun.js
Apache License 2.0
519 stars 110 forks source link

Incorrect example documentation for Events? #379

Closed zacharytyhacz closed 1 year ago

zacharytyhacz commented 1 year ago

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 commented 1 year ago

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: https://github.com/mailgun/mailgun.js/blob/077eb691c754b28e7514995417522ae942f0bd51/lib/Types/Events/Events.ts#L9-L30

zacharytyhacz commented 1 year ago

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