{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa/pulls/comments/325729828","pull_request_review_id":289971703,"id":325729828,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyNTcyOTgyOA==","diff_hunk":"@@ -16,7 +16,7 @@ <h1 style=\"font-size: 1.1em; line-height: 1.5;\">\n   </td>\n </tr>\n \n-{{> button}}\n+{{> subscriptionButton}}","path":"packages/fxa-auth-server/lib/senders/templates/downloadSubscription.html","position":5,"original_position":5,"commit_id":"6cd2414bd868d46cf60c9ce6c5131fc04c21b2d1","original_commit_id":"6cd2414bd868d46cf60c9ce6c5131fc04c21b2d1","user":{"login":"philbooth","id":64367,"node_id":"MDQ6VXNlcjY0MzY3","avatar_url":"https://avatars2.githubusercontent.com/u/64367?v=4","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"body":"The subscription emails have a different button style.","created_at":"2019-09-18T15:02:53Z","updated_at":"2019-09-18T15:29:11Z","html_url":"https://github.com/mozilla/fxa/pull/2535#discussion_r325729828","pull_request_url":"https://api.github.com/repos/mozilla/fxa/pulls/2535","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/comments/325729828"},"html":{"href":"https://github.com/mozilla/fxa/pull/2535#discussion_r325729828"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/2535"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa/pulls/2535","id":318542005,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE4NTQyMDA1","html_url":"https://github.com/mozilla/fxa/pull/2535","diff_url":"https://github.com/mozilla/fxa/pull/2535.diff","patch_url":"https://github.com/mozilla/fxa/pull/2535.patch","issue_url":"https://api.github.com/repos/mozilla/fxa/issues/2535","number":2535,"state":"open","locked":false,"title":"refactor(email): reduce email-sending boilerplate","user":{"login":"philbooth","id":64367,"node_id":"MDQ6VXNlcjY0MzY3","avatar_url":"https://avatars2.githubusercontent.com/u/64367?v=4","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"body":"Fixes #1779.\r\n\r\nI've had a long-standing desire to clean up the email-sending code in the auth server and eliminate some of the repetition from it. But now I have to document that stuff for #2511 and I don't want to waste my time documenting bad code that we plan to refactor. And also my departure is looming and this is a loose end I don't want to leave hanging around. So I decided to see how far I could get with it today and what the outcome would look like.\r\n\r\nAs you can see from the headline, there's currently a net reduction of about 5.5k lines of code. It's not all working yet, I still have to wade through some outstanding test failures and properly eyeball all of the rendered emails to make sure nothing is broken. But I'm encouraged with the direction. Opening as a draft to put it in the public domain in case people are interested.\r\n\r\nBriefly the changes are:\r\n\r\n* The remaining nunjucks stuff has been removed. All of the templates are now 100% handlebars.\r\n\r\n* The templates have all been migrated to the layouts/partials structure I implemented for #1791 and the `subscription-templates` directory from that PR has been merged into the one-and-only `templates` directory.\r\n\r\n* The extra layer of indirection for each function in `lib/senders/index.js` has mostly been replaced by a single function that works in all cases, except for `sendVerifySecondaryEmail` and `sendPostVerifySecondaryEmail`, which still have bespoke wrappers (for now).\r\n\r\n* There's been some collateral clean-up of names to facilitate the reduction in boilerplate, which has hopefully made the mailer API more consistent to consume.\r\n\r\n* Lots of repeated common markup in the templates has been extracted to new partials.\r\n\r\n* There were a number of cases of broken markup that I spotted while creating those new partials, so we have well-formed markup now.\r\n\r\nI'll come back tomorrow morning with fresh eyes to fix the stuff that's broken. I'm already aware of one merge conflict where templates were changed in `master` but have been reverted here. I'll be sure to remove those tomorrow, hopefully there won't be too many more merge conflicts after that.","created_at":"2019-09-17T21:56:38Z","updated_at":"2019-09-18T15:29:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9842e8f86a711879f2b09e975be7fd7fc03f5b1","assignee":{"login":"philbooth","id":64367,"node_id":"MDQ6VXNlcjY0MzY3","avatar_url":"https://avatars2.githubusercontent.com/u/64367?v=4","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"assignees":[{"login":"philbooth","id":64367,"node_id":"MDQ6VXNlcjY0MzY3","avatar_url":"https://avatars2.githubusercontent.com/u/64367?v=4","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/mozilla/fxa/milestones/114","html_url":"https://github.com/mozilla/fxa/milestone/114","labels_url":"https://api.github.com/repos/mozilla/fxa/milestones/114/labels","id":4645105,"node_id":"MDk6TWlsZXN0b25lNDY0NTEwNQ==","number":114,"title":"Train 147: FxA","description":"","creator":{"login":"clouserw","id":80098,"node_id":"MDQ6VXNlcjgwMDk4","avatar_url":"https://avatars3.githubusercontent.com/u/80098?v=4","gravatar_id":"","url":"https://api.github.com/users/clouserw","html_url":"https://github.com/clouserw","followers_url":"https://api.github.com/users/clouserw/followers","following_url":"https://api.github.com/users/clouserw/following{/other_user}","gists_url":"https://api.github.com/users/clouserw/gists{/gist_id}","starred_url":"https://api.github.com/users/clouserw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouserw/subscriptions","organizations_url":"https://api.github.com/users/clouserw/orgs","repos_url":"https://api.github.com/users/clouserw/repos","events_url":"https://api.github.com/users/clouserw/events{/privacy}","received_events_url":"https://api.github.com/users/clouserw/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":5,"state":"open","created_at":"2019-09-09T16:22:45Z","updated_at":"2019-09-17T21:56:38Z","due_on":"2019-09-27T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mozilla/fxa/pulls/2535/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa/pulls/2535/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa/issues/2535/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa/statuses/6cd2414bd868d46cf60c9ce6c5131fc04c21b2d1","head":{"label":"mozilla:feature.refactor-email","ref":"feature.refactor-email","sha":"6cd2414bd868d46cf60c9ce6c5131fc04c21b2d1","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":36831081,"node_id":"MDEwOlJlcG9zaXRvcnkzNjgzMTA4MQ==","name":"fxa","full_name":"mozilla/fxa","private":false,"owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mozilla/fxa","description":"Monorepo for Firefox Accounts","fork":false,"url":"https://api.github.com/repos/mozilla/fxa","forks_url":"https://api.github.com/repos/mozilla/fxa/forks","keys_url":"https://api.github.com/repos/mozilla/fxa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa/events","assignees_url":"https://api.github.com/repos/mozilla/fxa/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa/merges","archive_url":"https://api.github.com/repos/mozilla/fxa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa/deployments","created_at":"2015-06-03T21:16:46Z","updated_at":"2019-09-18T01:13:47Z","pushed_at":"2019-09-18T14:35:17Z","git_url":"git://github.com/mozilla/fxa.git","ssh_url":"git@github.com:mozilla/fxa.git","clone_url":"https://github.com/mozilla/fxa.git","svn_url":"https://github.com/mozilla/fxa","homepage":"https://mozilla.github.io/application-services/docs/accounts/welcome.html","size":93442,"stargazers_count":101,"watchers_count":101,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":61,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":709,"license":null,"forks":61,"open_issues":709,"watchers":101,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"098fe0780059c44faa09f7b5f868624b36130a09","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":36831081,"node_id":"MDEwOlJlcG9zaXRvcnkzNjgzMTA4MQ==","name":"fxa","full_name":"mozilla/fxa","private":false,"owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mozilla/fxa","description":"Monorepo for Firefox Accounts","fork":false,"url":"https://api.github.com/repos/mozilla/fxa","forks_url":"https://api.github.com/repos/mozilla/fxa/forks","keys_url":"https://api.github.com/repos/mozilla/fxa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa/events","assignees_url":"https://api.github.com/repos/mozilla/fxa/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa/merges","archive_url":"https://api.github.com/repos/mozilla/fxa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa/deployments","created_at":"2015-06-03T21:16:46Z","updated_at":"2019-09-18T01:13:47Z","pushed_at":"2019-09-18T14:35:17Z","git_url":"git://github.com/mozilla/fxa.git","ssh_url":"git@github.com:mozilla/fxa.git","clone_url":"https://github.com/mozilla/fxa.git","svn_url":"https://github.com/mozilla/fxa","homepage":"https://mozilla.github.io/application-services/docs/accounts/welcome.html","size":93442,"stargazers_count":101,"watchers_count":101,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":61,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":709,"license":null,"forks":61,"open_issues":709,"watchers":101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/2535"},"html":{"href":"https://github.com/mozilla/fxa/pull/2535"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa/issues/2535"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa/issues/2535/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/2535/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa/pulls/2535/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa/statuses/6cd2414bd868d46cf60c9ce6c5131fc04c21b2d1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"philbooth"}}