{"action":"created","issue":{"url":"https://api.github.com/repos/democracyworks/notification-works/issues/1","labels_url":"https://api.github.com/repos/democracyworks/notification-works/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/democracyworks/notification-works/issues/1/comments","events_url":"https://api.github.com/repos/democracyworks/notification-works/issues/1/events","html_url":"https://github.com/democracyworks/notification-works/pull/1","id":60025018,"number":1,"title":"[WR TH] initial commit","user":{"login":"bwreid","id":1316902,"avatar_url":"https://avatars.githubusercontent.com/u/1316902?v=3","gravatar_id":"","url":"https://api.github.com/users/bwreid","html_url":"https://github.com/bwreid","followers_url":"https://api.github.com/users/bwreid/followers","following_url":"https://api.github.com/users/bwreid/following{/other_user}","gists_url":"https://api.github.com/users/bwreid/gists{/gist_id}","starred_url":"https://api.github.com/users/bwreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwreid/subscriptions","organizations_url":"https://api.github.com/users/bwreid/orgs","repos_url":"https://api.github.com/users/bwreid/repos","events_url":"https://api.github.com/users/bwreid/events{/privacy}","received_events_url":"https://api.github.com/users/bwreid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tie-rack","id":3526,"avatar_url":"https://avatars.githubusercontent.com/u/3526?v=3","gravatar_id":"","url":"https://api.github.com/users/tie-rack","html_url":"https://github.com/tie-rack","followers_url":"https://api.github.com/users/tie-rack/followers","following_url":"https://api.github.com/users/tie-rack/following{/other_user}","gists_url":"https://api.github.com/users/tie-rack/gists{/gist_id}","starred_url":"https://api.github.com/users/tie-rack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tie-rack/subscriptions","organizations_url":"https://api.github.com/users/tie-rack/orgs","repos_url":"https://api.github.com/users/tie-rack/repos","events_url":"https://api.github.com/users/tie-rack/events{/privacy}","received_events_url":"https://api.github.com/users/tie-rack/received_events","type":"User","site_admin":false},"milestone":null,"comments":22,"created_at":"2015-03-05T22:14:33Z","updated_at":"2015-03-10T16:12:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/democracyworks/notification-works/pulls/1","html_url":"https://github.com/democracyworks/notification-works/pull/1","diff_url":"https://github.com/democracyworks/notification-works/pull/1.diff","patch_url":"https://github.com/democracyworks/notification-works/pull/1.patch"},"body":"This PR initializes notification-works and completes these two cards: [[1]](https://www.pivotaltracker.com/story/show/87662924) & [[2]](https://www.pivotaltracker.com/story/show/87666338)\r\n\r\nThis does the following:\r\n* Listens on the events topic exchange via `notification.send.queue`\r\n* Pulls an hbs template from an s3 bucket\r\n* Renders that template with given tags/params\r\n* Sends out messages on the queue \"sms\" or \"email\" depending on what medium is specified.\r\n\r\nTo run, do:\r\n```\r\ndocker-compose build\r\nAWS_ACCESS_KEY=[YOUR SECRET] AWS_SECRET_KEY=[YOUR ACCESS] docker-compose run\r\n```\r\n\r\nThen go to the rabbitmq web console and create two new queues: \"sms\" and \"email\". Go into the \"notification.send.queue\" and enter in a payload like the following:\r\n\r\n```\r\n{:medium :sms\r\n :slug \"test-template.hbs\"\r\n :context {:to \"your number\" :from \"my number\" :params {:first-name \"Turbo\"}}}\r\n```\r\n\r\nIf you go to the \"sms\" queue and get a message, you should see the message has come through with the template.\r\n\r\nAssigned @tie-rack."},"comment":{"url":"https://api.github.com/repos/democracyworks/notification-works/issues/comments/78087465","html_url":"https://github.com/democracyworks/notification-works/pull/1#issuecomment-78087465","issue_url":"https://api.github.com/repos/democracyworks/notification-works/issues/1","id":78087465,"user":{"login":"cap10morgan","id":59748,"avatar_url":"https://avatars.githubusercontent.com/u/59748?v=3","gravatar_id":"","url":"https://api.github.com/users/cap10morgan","html_url":"https://github.com/cap10morgan","followers_url":"https://api.github.com/users/cap10morgan/followers","following_url":"https://api.github.com/users/cap10morgan/following{/other_user}","gists_url":"https://api.github.com/users/cap10morgan/gists{/gist_id}","starred_url":"https://api.github.com/users/cap10morgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cap10morgan/subscriptions","organizations_url":"https://api.github.com/users/cap10morgan/orgs","repos_url":"https://api.github.com/users/cap10morgan/repos","events_url":"https://api.github.com/users/cap10morgan/events{/privacy}","received_events_url":"https://api.github.com/users/cap10morgan/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T16:12:15Z","updated_at":"2015-03-10T16:12:15Z","body":"Summary of action items:\r\n\r\n1. Address [inline comments](https://github.com/democracyworks/notification-works/pull/1/files)\r\n1. Change incoming queue name to `notification-works`.\r\n1. Change `:slug` to `:template`.\r\n1. Declare all queues it uses, even ones for sending to downstream medium gateways (email-works & sms-works).\r\n1. Drop the file name extension in the `:template` value (this may be just a documentation change for now, but it impacts a few of the things below).\r\n1. Template files need to become EDN files whose string values are themselves handlebars templates.\r\n    1. The `:template` value will refer to a .edn file in S3 which should contain a single map data structure.\r\n    1. We should then clojure.walk that map, calling `hbs/render` on every string value.\r\n    1. The schema of the EDN files should match what email-works expects for emails and what sms-works expects for text messages.\r\n    1. The `:medium` attribute should become metadata on the template maps now that they're becoming EDN. So like this: `^{:medium :sms} {:to \"{{recipient.phone}}\" :from \"{{sender.phone}}\" :body \"{{thingy}} says {{stuff}}\"`\r\n\r\nIf any of that \"templates are now EDN\" stuff doesn't make sense, let me know and I can pair on it w/ someone. It was driven by my initial attempt to make ballot-notification-works talk to notification-works and the real-world use cases that forced me to consider."}}