alphagov/email-alert-api — pull request #36 by bradleywright (2014-10-28 21:50:54+00:00)
Title: Rebuild API service as standard Rails app

Replaces #34 - this is a rebase/reorder of the work in that branch to be better about preserving history.

While hexagonal architecture is fine in principle, the complexity of the abstraction was getting in the way of delivering important bugs/features, namely:

- Queuing on the notification side of things - our external API partner typically returns a response in ~10 seconds, which is [unacceptable to downstream clients of our API](https://trello.com/c/G7bmYRkT/378-email-alert-api-times-out-regularly)
- Emails were being sent to [all topics we knew about](https://trello.com/c/Zbyhoudv/379-email-alert-api-appears-to-send-email-to-all-topics-rather-than-the-selected-ones), rather than just the specific tags that were sent

This pull request, almost entirely by @elliotcm, rewrites the application as a standard Rails application, and as a bonus implements queuing using Sidekiq and fixes the topic bug.

**Note**: this will require merging a [separate PR in gds-api-adapters](https://github.com/alphagov/gds-api-adapters/issues/232) to fix the URL namespacing that's changed (from underscore separated to dash-separated), and careful deployment (we'll want to wipe the database before deploying, as the migrations and schema have changed).

I recommend checking out the code and running it to test this - reading the diff is going to be hairy.