{"action":"created","issue":{"url":"https://api.github.com/repos/HTBox/allReady/issues/967","repository_url":"https://api.github.com/repos/HTBox/allReady","labels_url":"https://api.github.com/repos/HTBox/allReady/issues/967/labels{/name}","comments_url":"https://api.github.com/repos/HTBox/allReady/issues/967/comments","events_url":"https://api.github.com/repos/HTBox/allReady/issues/967/events","html_url":"https://github.com/HTBox/allReady/issues/967","id":162474004,"number":967,"title":"same code in AccountController.ForgotPassword and SendResetPasswordEmailHandler","user":{"login":"mgmccarthy","id":2428993,"avatar_url":"https://avatars.githubusercontent.com/u/2428993?v=3","gravatar_id":"","url":"https://api.github.com/users/mgmccarthy","html_url":"https://github.com/mgmccarthy","followers_url":"https://api.github.com/users/mgmccarthy/followers","following_url":"https://api.github.com/users/mgmccarthy/following{/other_user}","gists_url":"https://api.github.com/users/mgmccarthy/gists{/gist_id}","starred_url":"https://api.github.com/users/mgmccarthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgmccarthy/subscriptions","organizations_url":"https://api.github.com/users/mgmccarthy/orgs","repos_url":"https://api.github.com/users/mgmccarthy/repos","events_url":"https://api.github.com/users/mgmccarthy/events{/privacy}","received_events_url":"https://api.github.com/users/mgmccarthy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-27T15:02:45Z","updated_at":"2016-07-19T14:50:36Z","closed_at":null,"body":"@tonysurma @MisterJames. Can we get a decision on the \"verbiage\" here and I can refactor out the duplicate code.\r\n\r\nAccountController allows you to send a forgot password email via this code:\r\n`await _emailSender.SendEmailAsync(model.Email, \"Reset allReady Password\", $\"Please reset your allReady password by clicking here: <a href=\\\"{callbackUrl}\\\">link</a>\");`\r\n\r\nSiteAdminController (AllReady.Areas.Admin.Controllers.SiteController) allows you to reset your password via email by sending `SendResetPasswordEmail`.\r\n\r\n`SendResetPasswordEmailHandler` handles `SendResetPasswordEmail` via this code:\r\n`await emailSender.SendEmailAsync(message.Email, \"Reset Password\", $\"Please reset your password by clicking here: <a href=\\\"{message.CallbackUrl}\\\">link</a>\");`\r\n\r\nthis is the **same exact message** with the difference being AccountController adds the word \"allReady\" to the message. In both cases, the objective of sending the message is the same, to reset your password.\r\n\r\nsince we construct the CallBackUrl in the controller and supply the email from the controller before sending the message, we should centralize the \"reset password\" functionality to use one command/handler so we're centralizing the construction of the actual message in the handler, and then choosing how we want to deliver it from the handler (in this case, the handler has IEmailSender injected).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/HTBox/allReady/issues/comments/233657434","html_url":"https://github.com/HTBox/allReady/issues/967#issuecomment-233657434","issue_url":"https://api.github.com/repos/HTBox/allReady/issues/967","id":233657434,"user":{"login":"mgmccarthy","id":2428993,"avatar_url":"https://avatars.githubusercontent.com/u/2428993?v=3","gravatar_id":"","url":"https://api.github.com/users/mgmccarthy","html_url":"https://github.com/mgmccarthy","followers_url":"https://api.github.com/users/mgmccarthy/followers","following_url":"https://api.github.com/users/mgmccarthy/following{/other_user}","gists_url":"https://api.github.com/users/mgmccarthy/gists{/gist_id}","starred_url":"https://api.github.com/users/mgmccarthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgmccarthy/subscriptions","organizations_url":"https://api.github.com/users/mgmccarthy/orgs","repos_url":"https://api.github.com/users/mgmccarthy/repos","events_url":"https://api.github.com/users/mgmccarthy/events{/privacy}","received_events_url":"https://api.github.com/users/mgmccarthy/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T14:50:36Z","updated_at":"2016-07-19T14:50:36Z","body":"I'm currently working on this. @tonysurma, can you please assign to me?"}}
{"actor":{"display_login":"mgmccarthy"}}