Show HN: MailgunLogger
github.comAwesome - we've slowly moved so many of the mailgun events into our own system over the years, that it probably made sense to just start with an "everything' approach to begin with!
I have asked mailgun a number of times if they'd simply charge for longer storage limits, and they said no.
Thanks for setting this up!
Won't mailgun send all of the same information via event callbacks, or is there event information only available through their web interface?
Not the author, but have some experience with the mailgun api. AFAIK there's no sla/guarantee/redelivery for the webhooks, and they have to be setup for each domain. Looping the account to fetch all logs for the last 48 hours is relatively simple and robust.
OP here (actually, he is my co-founder, same company). I can confirm this experience, looping seems to work.
In our own setup, we fetch data for the last 24h twice a day and then just insert everything. We have a db constraint on the message ID mailgun sends us, so only news ones will be persisted. We aren't even bothered with filtering before inserting, the db constraint does the trick.
This is very timely! I'd love to see the logging bits extracted out into its own library so I can use it directly in an existing Phoenix app. I don't really need the GUI bits.
You should be able to still use it. Just set `runtime: false` for the dep entry in your `mix.exs` file and only start what you need.
OP here. We saw your request on github, will follow up there. Should not be that hard to do, it's not a lot of code actually.
Elixir :)