{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/comments/176669644","pull_request_review_id":106413399,"id":176669644,"diff_hunk":"@@ -0,0 +1,149 @@\n+class SubscriptionsManagementController < ApplicationController\n+  before_action :set_cache_control_header\n+  before_action :check_if_access_is_enabled\n+  before_action :get_subscriptions\n+\n+  MISSING_EMAIL_ERROR = \"Please enter your email address.\".freeze\n+  INVALID_EMAIL_ERROR = \"This doesn’t look like a valid email address – check you’ve entered it correctly.\".freeze\n+\n+  def index; end\n+\n+  def update_frequency\n+    @back_url = list_subscriptions_path\n+    @subscription_id = subscription_id\n+    @current_frequency = @subscriptions[@subscription_id]['frequency']\n+  end\n+\n+  def change_frequency\n+    # TODO: Enable this\n+    # email_alert_api.change_subscription(\n+    #   id: subscription_id,\n+    #   frequency: new_frequency\n+    # )\n+    session[:subscriptions][subscription_id]['frequency'] = new_frequency\n+\n+    #clear_subscriptions!\n+\n+    redirect_to list_subscriptions_path\n+  end\n+\n+  def update_address\n+    @back_url = list_subscriptions_path\n+    @address = @subscriber['address']\n+  end\n+\n+  def change_address","path":"app/controllers/subscriptions_management_controller.rb","position":35,"original_position":35,"commit_id":"35273141884a425cf1e71ff7b69462b99b9c5c16","original_commit_id":"35273141884a425cf1e71ff7b69462b99b9c5c16","user":{"login":"bevanloon","id":647311,"avatar_url":"https://avatars1.githubusercontent.com/u/647311?v=4","gravatar_id":"","url":"https://api.github.com/users/bevanloon","html_url":"https://github.com/bevanloon","followers_url":"https://api.github.com/users/bevanloon/followers","following_url":"https://api.github.com/users/bevanloon/following{/other_user}","gists_url":"https://api.github.com/users/bevanloon/gists{/gist_id}","starred_url":"https://api.github.com/users/bevanloon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bevanloon/subscriptions","organizations_url":"https://api.github.com/users/bevanloon/orgs","repos_url":"https://api.github.com/users/bevanloon/repos","events_url":"https://api.github.com/users/bevanloon/events{/privacy}","received_events_url":"https://api.github.com/users/bevanloon/received_events","type":"User","site_admin":false},"body":"When we update an email address, is the current plan to just update with no confirmation or are we going to set up a confirmation link to both old and new email addresses before we action it? If we go the paranoid route then changing an address should probably invalidate the session and tell them to do the confirmation dance....","created_at":"2018-03-23T08:49:49Z","updated_at":"2018-03-23T08:57:15Z","html_url":"https://github.com/alphagov/email-alert-frontend/pull/183#discussion_r176669644","pull_request_url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/comments/176669644"},"html":{"href":"https://github.com/alphagov/email-alert-frontend/pull/183#discussion_r176669644"},"pull_request":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183","id":176853963,"html_url":"https://github.com/alphagov/email-alert-frontend/pull/183","diff_url":"https://github.com/alphagov/email-alert-frontend/pull/183.diff","patch_url":"https://github.com/alphagov/email-alert-frontend/pull/183.patch","issue_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/183","number":183,"state":"open","locked":false,"title":"[WIP] Add subscription management frontend","user":{"login":"rubenarakelyan","id":444232,"avatar_url":"https://avatars0.githubusercontent.com/u/444232?v=4","gravatar_id":"","url":"https://api.github.com/users/rubenarakelyan","html_url":"https://github.com/rubenarakelyan","followers_url":"https://api.github.com/users/rubenarakelyan/followers","following_url":"https://api.github.com/users/rubenarakelyan/following{/other_user}","gists_url":"https://api.github.com/users/rubenarakelyan/gists{/gist_id}","starred_url":"https://api.github.com/users/rubenarakelyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubenarakelyan/subscriptions","organizations_url":"https://api.github.com/users/rubenarakelyan/orgs","repos_url":"https://api.github.com/users/rubenarakelyan/repos","events_url":"https://api.github.com/users/rubenarakelyan/events{/privacy}","received_events_url":"https://api.github.com/users/rubenarakelyan/received_events","type":"User","site_admin":false},"body":"This commit adds the subscription management frontend, which allows subscribers to view their subscriptions, change their email address, change the frequency of a subscription, unsubscribe from a list or unsubscribe from everything.","created_at":"2018-03-22T17:28:30Z","updated_at":"2018-03-23T08:57:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"403f883add5c50f5098908f34239010f562ea99a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183/commits","review_comments_url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183/comments","review_comment_url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/183/comments","statuses_url":"https://api.github.com/repos/alphagov/email-alert-frontend/statuses/35273141884a425cf1e71ff7b69462b99b9c5c16","head":{"label":"alphagov:add-subscription-management-frontend","ref":"add-subscription-management-frontend","sha":"35273141884a425cf1e71ff7b69462b99b9c5c16","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":30589536,"name":"email-alert-frontend","full_name":"alphagov/email-alert-frontend","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/email-alert-frontend","description":"Serves email alert signup pages on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/email-alert-frontend","forks_url":"https://api.github.com/repos/alphagov/email-alert-frontend/forks","keys_url":"https://api.github.com/repos/alphagov/email-alert-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/email-alert-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/email-alert-frontend/teams","hooks_url":"https://api.github.com/repos/alphagov/email-alert-frontend/hooks","issue_events_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/email-alert-frontend/events","assignees_url":"https://api.github.com/repos/alphagov/email-alert-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/email-alert-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/email-alert-frontend/tags","blobs_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/email-alert-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/email-alert-frontend/languages","stargazers_url":"https://api.github.com/repos/alphagov/email-alert-frontend/stargazers","contributors_url":"https://api.github.com/repos/alphagov/email-alert-frontend/contributors","subscribers_url":"https://api.github.com/repos/alphagov/email-alert-frontend/subscribers","subscription_url":"https://api.github.com/repos/alphagov/email-alert-frontend/subscription","commits_url":"https://api.github.com/repos/alphagov/email-alert-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/email-alert-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/email-alert-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/email-alert-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/email-alert-frontend/merges","archive_url":"https://api.github.com/repos/alphagov/email-alert-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/email-alert-frontend/downloads","issues_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/email-alert-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/email-alert-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/email-alert-frontend/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/email-alert-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/email-alert-frontend/deployments","created_at":"2015-02-10T11:43:01Z","updated_at":"2018-03-22T10:07:42Z","pushed_at":"2018-03-23T08:45:47Z","git_url":"git://github.com/alphagov/email-alert-frontend.git","ssh_url":"git@github.com:alphagov/email-alert-frontend.git","clone_url":"https://github.com/alphagov/email-alert-frontend.git","svn_url":"https://github.com/alphagov/email-alert-frontend","homepage":"https://docs.publishing.service.gov.uk/apps/email-alert-frontend.html","size":502,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"293622d9cb60d838560cefe60f4c577728d0bfb0","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":30589536,"name":"email-alert-frontend","full_name":"alphagov/email-alert-frontend","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/email-alert-frontend","description":"Serves email alert signup pages on GOV.UK","fork":false,"url":"https://api.github.com/repos/alphagov/email-alert-frontend","forks_url":"https://api.github.com/repos/alphagov/email-alert-frontend/forks","keys_url":"https://api.github.com/repos/alphagov/email-alert-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/email-alert-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/email-alert-frontend/teams","hooks_url":"https://api.github.com/repos/alphagov/email-alert-frontend/hooks","issue_events_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/email-alert-frontend/events","assignees_url":"https://api.github.com/repos/alphagov/email-alert-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/email-alert-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/email-alert-frontend/tags","blobs_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/email-alert-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/email-alert-frontend/languages","stargazers_url":"https://api.github.com/repos/alphagov/email-alert-frontend/stargazers","contributors_url":"https://api.github.com/repos/alphagov/email-alert-frontend/contributors","subscribers_url":"https://api.github.com/repos/alphagov/email-alert-frontend/subscribers","subscription_url":"https://api.github.com/repos/alphagov/email-alert-frontend/subscription","commits_url":"https://api.github.com/repos/alphagov/email-alert-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/email-alert-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/email-alert-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/email-alert-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/email-alert-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/email-alert-frontend/merges","archive_url":"https://api.github.com/repos/alphagov/email-alert-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/email-alert-frontend/downloads","issues_url":"https://api.github.com/repos/alphagov/email-alert-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/email-alert-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/email-alert-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/email-alert-frontend/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/email-alert-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/email-alert-frontend/deployments","created_at":"2015-02-10T11:43:01Z","updated_at":"2018-03-22T10:07:42Z","pushed_at":"2018-03-23T08:45:47Z","git_url":"git://github.com/alphagov/email-alert-frontend.git","ssh_url":"git@github.com:alphagov/email-alert-frontend.git","clone_url":"https://github.com/alphagov/email-alert-frontend.git","svn_url":"https://github.com/alphagov/email-alert-frontend","homepage":"https://docs.publishing.service.gov.uk/apps/email-alert-frontend.html","size":502,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183"},"html":{"href":"https://github.com/alphagov/email-alert-frontend/pull/183"},"issue":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/183"},"comments":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/issues/183/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/pulls/183/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/email-alert-frontend/statuses/35273141884a425cf1e71ff7b69462b99b9c5c16"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bevanloon"}}