{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/comments/74222668","id":74222668,"diff_hunk":"@@ -25,25 +25,29 @@ function logSubscription({deviceId, email}) {\n \t// don't wait on this promise, log in the background\n \tcall(`/user/${email}`, null, 'GET').then(r => r.json().then(json => {\n \t\tif(r.ok) {\n-\t\t\tlogger.info(`anon-email-api subscribed user (device ${deviceId}) as ${json.uuid}`)\n+\t\t\tlogger.info(`anon-email-api subscribed user as ${json.uuid}`, { deviceId })\n \t\t} else {\n \t\t\tconst err = new Error(JSON.stringify(json));\n \t\t\terr.response = r;\n \t\t}\n \t})).catch(e => logger.warn(e));\n }\n \n-export function subscribe({email, mailingList, deviceId, topics}={}) {\n-\tlogger.info(`anon-email-api about to subscribe user (device ${deviceId}) to ${mailingList} with topics: ${topics}`);\n-\n+export function subscribe({ email, mailingList, deviceId, topics, following } = { }) {\n \tlet status;\n+\tconst data = {\n+\t\tmailingListName: mailingList,\n+\t\tuserEmail: email,\n+\t\tdeviceId\n+\t};\n+\tif (following) {\n+\t\tdata.following = following;\n+\t} else {\n+\t\tdata.topics = topics;\n+\t}\n+\tlogger.info('anon-email-api about to subscribe user', data);","path":"src/api/anon-email-lists.js","position":28,"original_position":28,"commit_id":"cc8cd342009452d92083b2fe70d5f57651211bc3","original_commit_id":"cc8cd342009452d92083b2fe70d5f57651211bc3","user":{"login":"tavvy","id":660635,"avatar_url":"https://avatars.githubusercontent.com/u/660635?v=3","gravatar_id":"","url":"https://api.github.com/users/tavvy","html_url":"https://github.com/tavvy","followers_url":"https://api.github.com/users/tavvy/followers","following_url":"https://api.github.com/users/tavvy/following{/other_user}","gists_url":"https://api.github.com/users/tavvy/gists{/gist_id}","starred_url":"https://api.github.com/users/tavvy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavvy/subscriptions","organizations_url":"https://api.github.com/users/tavvy/orgs","repos_url":"https://api.github.com/users/tavvy/repos","events_url":"https://api.github.com/users/tavvy/events{/privacy}","received_events_url":"https://api.github.com/users/tavvy/received_events","type":"User","site_admin":false},"body":"we might want to be careful about logging the user email here. maybe `n-mask-logger`?","created_at":"2016-08-10T10:46:36Z","updated_at":"2016-08-10T10:46:36Z","html_url":"https://github.com/Financial-Times/newsletter-signup/pull/25#discussion_r74222668","pull_request_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/comments/74222668"},"html":{"href":"https://github.com/Financial-Times/newsletter-signup/pull/25#discussion_r74222668"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25","id":80756950,"html_url":"https://github.com/Financial-Times/newsletter-signup/pull/25","diff_url":"https://github.com/Financial-Times/newsletter-signup/pull/25.diff","patch_url":"https://github.com/Financial-Times/newsletter-signup/pull/25.patch","issue_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/25","number":25,"state":"open","locked":false,"title":"Ability to send 'following' data","user":{"login":"ironsidevsquincy","id":74132,"avatar_url":"https://avatars.githubusercontent.com/u/74132?v=3","gravatar_id":"","url":"https://api.github.com/users/ironsidevsquincy","html_url":"https://github.com/ironsidevsquincy","followers_url":"https://api.github.com/users/ironsidevsquincy/followers","following_url":"https://api.github.com/users/ironsidevsquincy/following{/other_user}","gists_url":"https://api.github.com/users/ironsidevsquincy/gists{/gist_id}","starred_url":"https://api.github.com/users/ironsidevsquincy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironsidevsquincy/subscriptions","organizations_url":"https://api.github.com/users/ironsidevsquincy/orgs","repos_url":"https://api.github.com/users/ironsidevsquincy/repos","events_url":"https://api.github.com/users/ironsidevsquincy/events{/privacy}","received_events_url":"https://api.github.com/users/ironsidevsquincy/received_events","type":"User","site_admin":false},"body":"Slightly more verbose than it needs to be as keeping it backwards compatible by giving `topics` a default of `default`\r\n\r\nIf both `topics` and `following` is sent, only `following` is sent (make sense?)","created_at":"2016-08-10T08:53:06Z","updated_at":"2016-08-10T10:46:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaede2c4a9497c4c7a3573987b434860503ab91b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/25/comments","statuses_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/statuses/cc8cd342009452d92083b2fe70d5f57651211bc3","head":{"label":"Financial-Times:following-data","ref":"following-data","sha":"cc8cd342009452d92083b2fe70d5f57651211bc3","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":57382351,"name":"newsletter-signup","full_name":"Financial-Times/newsletter-signup","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/newsletter-signup","description":null,"fork":false,"url":"https://api.github.com/repos/Financial-Times/newsletter-signup","forks_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/forks","keys_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/teams","hooks_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/events","assignees_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/tags","blobs_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/subscription","commits_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/merges","archive_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/downloads","issues_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/deployments","created_at":"2016-04-29T12:28:00Z","updated_at":"2016-05-05T16:10:47Z","pushed_at":"2016-08-10T08:53:06Z","git_url":"git://github.com/Financial-Times/newsletter-signup.git","ssh_url":"git@github.com:Financial-Times/newsletter-signup.git","clone_url":"https://github.com/Financial-Times/newsletter-signup.git","svn_url":"https://github.com/Financial-Times/newsletter-signup","homepage":null,"size":143,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"962782d1a70c7869b08354d4c4ed7bc24ff09126","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":57382351,"name":"newsletter-signup","full_name":"Financial-Times/newsletter-signup","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/newsletter-signup","description":null,"fork":false,"url":"https://api.github.com/repos/Financial-Times/newsletter-signup","forks_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/forks","keys_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/teams","hooks_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/events","assignees_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/tags","blobs_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/subscription","commits_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/merges","archive_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/downloads","issues_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/newsletter-signup/deployments","created_at":"2016-04-29T12:28:00Z","updated_at":"2016-05-05T16:10:47Z","pushed_at":"2016-08-10T08:53:06Z","git_url":"git://github.com/Financial-Times/newsletter-signup.git","ssh_url":"git@github.com:Financial-Times/newsletter-signup.git","clone_url":"https://github.com/Financial-Times/newsletter-signup.git","svn_url":"https://github.com/Financial-Times/newsletter-signup","homepage":null,"size":143,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25"},"html":{"href":"https://github.com/Financial-Times/newsletter-signup/pull/25"},"issue":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/25"},"comments":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/newsletter-signup/statuses/cc8cd342009452d92083b2fe70d5f57651211bc3"}}}}
{"actor":{"display_login":"tavvy"}}