Sample Ruby on Rails that would:
- receive webhooks from Mandrill
- processes the webhook data and stores it into a suitable data store
- displays the following statistics
- total number of emails sent
- total number of emails opened
- total number of clicks
- open rate per email type
- click rate per email type
Note: The application is overkill for simple task like this (no need for processor object, or for use of a heavy framework like Rails) I was just demonstrating solution to particilar problem/approach at one job interview.
Point Mandrill event webhook to /api/v1/events
Processing of Events is done via background job so make sure delayed job
is running bundle exec bin/delayed_job start
- introduce Russion-Doll caching or level caching
- implement policy clases for authentication & authorization
- pagination
- search with ransack
- implement Sidekiq for background processing
- extract Event#raw to some more sutable storage (Redis? Mongo?)
If This project is not exactly what you were looking for, check my other similar project built in Sinatra doing similar thing for SendGrid Sendgrid Event Webhook Collector