{"action":"created","comment":{"url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/comments/241960388","pull_request_review_id":185366626,"id":241960388,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTk2MDM4OA==","diff_hunk":"@@ -0,0 +1,16 @@\n+import { Request, Response } from 'express';\n+import * as mailchimp from 'mailchimp-api';\n+\n+const MC = new mailchimp.Mailchimp(process.env.MAILCHIMP_API_KEY);\n+\n+export function createSubscription(req: Request, res: Response) {\n+  // TODO: Check user is already subscribed\n+  MC.lists.subscribe({\n+    id: process.env.MAILCHIMP_INTERESTED_LIST_ID,\n+    email: { email: req.body.email },\n+    merge_vars: { EMAIL: req.body.email },\n+    update_existing: true\n+  },\n+  _ => res.json('An email requesting your confirmation has been sent to the address you provided.'),\n+  err => err.name === 'ValidationError' ? res.status(400).json(err.error) : res.status(500).json(err.error));","path":"src/server/controllers/email-subscriptions-controller.ts","position":15,"original_position":15,"commit_id":"6048c0c285508d7238b3de6d35f7c0edc601cf94","original_commit_id":"6048c0c285508d7238b3de6d35f7c0edc601cf94","user":{"login":"henrymercer","id":14129055,"node_id":"MDQ6VXNlcjE0MTI5MDU1","avatar_url":"https://avatars1.githubusercontent.com/u/14129055?v=4","gravatar_id":"","url":"https://api.github.com/users/henrymercer","html_url":"https://github.com/henrymercer","followers_url":"https://api.github.com/users/henrymercer/followers","following_url":"https://api.github.com/users/henrymercer/following{/other_user}","gists_url":"https://api.github.com/users/henrymercer/gists{/gist_id}","starred_url":"https://api.github.com/users/henrymercer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrymercer/subscriptions","organizations_url":"https://api.github.com/users/henrymercer/orgs","repos_url":"https://api.github.com/users/henrymercer/repos","events_url":"https://api.github.com/users/henrymercer/events{/privacy}","received_events_url":"https://api.github.com/users/henrymercer/received_events","type":"User","site_admin":false},"body":"In general I think we should avoid displaying unknown error messages in the response, in case we end up leaking information.  Rather we should display a generic error message to the user and log the actual error on the server.","created_at":"2018-12-15T20:49:39Z","updated_at":"2018-12-15T20:50:50Z","html_url":"https://github.com/hackcambridge/hack-cambridge-website/pull/579#discussion_r241960388","pull_request_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/comments/241960388"},"html":{"href":"https://github.com/hackcambridge/hack-cambridge-website/pull/579#discussion_r241960388"},"pull_request":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579"}}},"pull_request":{"url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579","id":237354992,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MzU0OTky","html_url":"https://github.com/hackcambridge/hack-cambridge-website/pull/579","diff_url":"https://github.com/hackcambridge/hack-cambridge-website/pull/579.diff","patch_url":"https://github.com/hackcambridge/hack-cambridge-website/pull/579.patch","issue_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/579","number":579,"state":"open","locked":false,"title":"Use Stimulus and rails-ujs for mailing list form","user":{"login":"jmalcic","id":18505817,"node_id":"MDQ6VXNlcjE4NTA1ODE3","avatar_url":"https://avatars0.githubusercontent.com/u/18505817?v=4","gravatar_id":"","url":"https://api.github.com/users/jmalcic","html_url":"https://github.com/jmalcic","followers_url":"https://api.github.com/users/jmalcic/followers","following_url":"https://api.github.com/users/jmalcic/following{/other_user}","gists_url":"https://api.github.com/users/jmalcic/gists{/gist_id}","starred_url":"https://api.github.com/users/jmalcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmalcic/subscriptions","organizations_url":"https://api.github.com/users/jmalcic/orgs","repos_url":"https://api.github.com/users/jmalcic/repos","events_url":"https://api.github.com/users/jmalcic/events{/privacy}","received_events_url":"https://api.github.com/users/jmalcic/received_events","type":"User","site_admin":false},"body":"This pull request stops using jQuery for the mailing list signup form, with Stimulus and rails-ujs replacing most of the original functionality. This will help to achieve the goal of dropping jQuery as a dependency when the live page is refactored.","created_at":"2018-12-10T15:12:27Z","updated_at":"2018-12-15T20:50:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55bf71bb099f8bb311968bff2381d9289a680ef0","assignee":{"login":"jmalcic","id":18505817,"node_id":"MDQ6VXNlcjE4NTA1ODE3","avatar_url":"https://avatars0.githubusercontent.com/u/18505817?v=4","gravatar_id":"","url":"https://api.github.com/users/jmalcic","html_url":"https://github.com/jmalcic","followers_url":"https://api.github.com/users/jmalcic/followers","following_url":"https://api.github.com/users/jmalcic/following{/other_user}","gists_url":"https://api.github.com/users/jmalcic/gists{/gist_id}","starred_url":"https://api.github.com/users/jmalcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmalcic/subscriptions","organizations_url":"https://api.github.com/users/jmalcic/orgs","repos_url":"https://api.github.com/users/jmalcic/repos","events_url":"https://api.github.com/users/jmalcic/events{/privacy}","received_events_url":"https://api.github.com/users/jmalcic/received_events","type":"User","site_admin":false},"assignees":[{"login":"jmalcic","id":18505817,"node_id":"MDQ6VXNlcjE4NTA1ODE3","avatar_url":"https://avatars0.githubusercontent.com/u/18505817?v=4","gravatar_id":"","url":"https://api.github.com/users/jmalcic","html_url":"https://github.com/jmalcic","followers_url":"https://api.github.com/users/jmalcic/followers","following_url":"https://api.github.com/users/jmalcic/following{/other_user}","gists_url":"https://api.github.com/users/jmalcic/gists{/gist_id}","starred_url":"https://api.github.com/users/jmalcic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmalcic/subscriptions","organizations_url":"https://api.github.com/users/jmalcic/orgs","repos_url":"https://api.github.com/users/jmalcic/repos","events_url":"https://api.github.com/users/jmalcic/events{/privacy}","received_events_url":"https://api.github.com/users/jmalcic/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579/commits","review_comments_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579/comments","review_comment_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/579/comments","statuses_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/statuses/6048c0c285508d7238b3de6d35f7c0edc601cf94","head":{"label":"hackcambridge:frontend/mailing-list-signup","ref":"frontend/mailing-list-signup","sha":"6048c0c285508d7238b3de6d35f7c0edc601cf94","user":{"login":"hackcambridge","id":21050882,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDUwODgy","avatar_url":"https://avatars2.githubusercontent.com/u/21050882?v=4","gravatar_id":"","url":"https://api.github.com/users/hackcambridge","html_url":"https://github.com/hackcambridge","followers_url":"https://api.github.com/users/hackcambridge/followers","following_url":"https://api.github.com/users/hackcambridge/following{/other_user}","gists_url":"https://api.github.com/users/hackcambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/hackcambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackcambridge/subscriptions","organizations_url":"https://api.github.com/users/hackcambridge/orgs","repos_url":"https://api.github.com/users/hackcambridge/repos","events_url":"https://api.github.com/users/hackcambridge/events{/privacy}","received_events_url":"https://api.github.com/users/hackcambridge/received_events","type":"Organization","site_admin":false},"repo":{"id":45483873,"node_id":"MDEwOlJlcG9zaXRvcnk0NTQ4Mzg3Mw==","name":"hack-cambridge-website","full_name":"hackcambridge/hack-cambridge-website","private":false,"owner":{"login":"hackcambridge","id":21050882,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDUwODgy","avatar_url":"https://avatars2.githubusercontent.com/u/21050882?v=4","gravatar_id":"","url":"https://api.github.com/users/hackcambridge","html_url":"https://github.com/hackcambridge","followers_url":"https://api.github.com/users/hackcambridge/followers","following_url":"https://api.github.com/users/hackcambridge/following{/other_user}","gists_url":"https://api.github.com/users/hackcambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/hackcambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackcambridge/subscriptions","organizations_url":"https://api.github.com/users/hackcambridge/orgs","repos_url":"https://api.github.com/users/hackcambridge/repos","events_url":"https://api.github.com/users/hackcambridge/events{/privacy}","received_events_url":"https://api.github.com/users/hackcambridge/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hackcambridge/hack-cambridge-website","description":"Hack Cambridge online! https://hackcambridge.com","fork":false,"url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website","forks_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/forks","keys_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/teams","hooks_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/hooks","issue_events_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/events{/number}","events_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/events","assignees_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/assignees{/user}","branches_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/branches{/branch}","tags_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/tags","blobs_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/statuses/{sha}","languages_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/languages","stargazers_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/stargazers","contributors_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/contributors","subscribers_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/subscribers","subscription_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/subscription","commits_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/contents/{+path}","compare_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/merges","archive_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/downloads","issues_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues{/number}","pulls_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls{/number}","milestones_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/milestones{/number}","notifications_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/labels{/name}","releases_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/releases{/id}","deployments_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/deployments","created_at":"2015-11-03T17:37:46Z","updated_at":"2018-12-13T14:36:32Z","pushed_at":"2018-12-13T14:36:33Z","git_url":"git://github.com/hackcambridge/hack-cambridge-website.git","ssh_url":"git@github.com:hackcambridge/hack-cambridge-website.git","clone_url":"https://github.com/hackcambridge/hack-cambridge-website.git","svn_url":"https://github.com/hackcambridge/hack-cambridge-website","homepage":"","size":12400,"stargazers_count":7,"watchers_count":7,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":30,"watchers":7,"default_branch":"master"}},"base":{"label":"hackcambridge:master","ref":"master","sha":"16c31adb3d98baeba6646257a9fb4ed134c3c513","user":{"login":"hackcambridge","id":21050882,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDUwODgy","avatar_url":"https://avatars2.githubusercontent.com/u/21050882?v=4","gravatar_id":"","url":"https://api.github.com/users/hackcambridge","html_url":"https://github.com/hackcambridge","followers_url":"https://api.github.com/users/hackcambridge/followers","following_url":"https://api.github.com/users/hackcambridge/following{/other_user}","gists_url":"https://api.github.com/users/hackcambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/hackcambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackcambridge/subscriptions","organizations_url":"https://api.github.com/users/hackcambridge/orgs","repos_url":"https://api.github.com/users/hackcambridge/repos","events_url":"https://api.github.com/users/hackcambridge/events{/privacy}","received_events_url":"https://api.github.com/users/hackcambridge/received_events","type":"Organization","site_admin":false},"repo":{"id":45483873,"node_id":"MDEwOlJlcG9zaXRvcnk0NTQ4Mzg3Mw==","name":"hack-cambridge-website","full_name":"hackcambridge/hack-cambridge-website","private":false,"owner":{"login":"hackcambridge","id":21050882,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDUwODgy","avatar_url":"https://avatars2.githubusercontent.com/u/21050882?v=4","gravatar_id":"","url":"https://api.github.com/users/hackcambridge","html_url":"https://github.com/hackcambridge","followers_url":"https://api.github.com/users/hackcambridge/followers","following_url":"https://api.github.com/users/hackcambridge/following{/other_user}","gists_url":"https://api.github.com/users/hackcambridge/gists{/gist_id}","starred_url":"https://api.github.com/users/hackcambridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackcambridge/subscriptions","organizations_url":"https://api.github.com/users/hackcambridge/orgs","repos_url":"https://api.github.com/users/hackcambridge/repos","events_url":"https://api.github.com/users/hackcambridge/events{/privacy}","received_events_url":"https://api.github.com/users/hackcambridge/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hackcambridge/hack-cambridge-website","description":"Hack Cambridge online! https://hackcambridge.com","fork":false,"url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website","forks_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/forks","keys_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/teams","hooks_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/hooks","issue_events_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/events{/number}","events_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/events","assignees_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/assignees{/user}","branches_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/branches{/branch}","tags_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/tags","blobs_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/statuses/{sha}","languages_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/languages","stargazers_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/stargazers","contributors_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/contributors","subscribers_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/subscribers","subscription_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/subscription","commits_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/contents/{+path}","compare_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/merges","archive_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/downloads","issues_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues{/number}","pulls_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls{/number}","milestones_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/milestones{/number}","notifications_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/labels{/name}","releases_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/releases{/id}","deployments_url":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/deployments","created_at":"2015-11-03T17:37:46Z","updated_at":"2018-12-13T14:36:32Z","pushed_at":"2018-12-13T14:36:33Z","git_url":"git://github.com/hackcambridge/hack-cambridge-website.git","ssh_url":"git@github.com:hackcambridge/hack-cambridge-website.git","clone_url":"https://github.com/hackcambridge/hack-cambridge-website.git","svn_url":"https://github.com/hackcambridge/hack-cambridge-website","homepage":"","size":12400,"stargazers_count":7,"watchers_count":7,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":8,"open_issues":30,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579"},"html":{"href":"https://github.com/hackcambridge/hack-cambridge-website/pull/579"},"issue":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/579"},"comments":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/issues/579/comments"},"review_comments":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579/comments"},"review_comment":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/pulls/579/commits"},"statuses":{"href":"https://api.github.com/repos/hackcambridge/hack-cambridge-website/statuses/6048c0c285508d7238b3de6d35f7c0edc601cf94"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"henrymercer"}}