{"action":"created","comment":{"url":"https://api.github.com/repos/andela/asgard-cfh/pulls/comments/194256722","pull_request_review_id":127396506,"id":194256722,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDI1NjcyMg==","diff_hunk":"@@ -269,3 +271,68 @@ exports.user = (req, res, next, id) => {\n       next();\n     });\n };\n+\n+/**\n+ * Invite user to play game.\n+ */\n+const sgMail = require('@sendgrid/mail');\n+\n+sgMail.setApiKey('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');\n+\n+exports.invite = (req, res) => {\n+  const { recieverEmail, gameURL } = req.body;\n+  const { name } = req;\n+  const msg = {\n+    from: 'cfh@andela.com', // sender address\n+    to: recieverEmail, // list of receivers\n+    subject: `${name} is inviting you to join a game`, // Subject line\n+    html: `<h1>Testing</h1><p>Join the game ${gameURL}</p>` // plain text body\n+  };","path":"app/controllers/users.js","position":53,"original_position":53,"commit_id":"4be6dd87ef70e491ceade264353950e99ecb2d34","original_commit_id":"4be6dd87ef70e491ceade264353950e99ecb2d34","user":{"login":"fortunee","id":12124618,"node_id":"MDQ6VXNlcjEyMTI0NjE4","avatar_url":"https://avatars2.githubusercontent.com/u/12124618?v=4","gravatar_id":"","url":"https://api.github.com/users/fortunee","html_url":"https://github.com/fortunee","followers_url":"https://api.github.com/users/fortunee/followers","following_url":"https://api.github.com/users/fortunee/following{/other_user}","gists_url":"https://api.github.com/users/fortunee/gists{/gist_id}","starred_url":"https://api.github.com/users/fortunee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fortunee/subscriptions","organizations_url":"https://api.github.com/users/fortunee/orgs","repos_url":"https://api.github.com/users/fortunee/repos","events_url":"https://api.github.com/users/fortunee/events{/privacy}","received_events_url":"https://api.github.com/users/fortunee/received_events","type":"User","site_admin":false},"body":"The comments on each line of this object is a bit unnecessary let's get rid of it. @Rhotimee @OlatunjiYso ","created_at":"2018-06-10T13:07:11Z","updated_at":"2018-06-10T13:07:12Z","html_url":"https://github.com/andela/asgard-cfh/pull/14#discussion_r194256722","pull_request_url":"https://api.github.com/repos/andela/asgard-cfh/pulls/14","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/andela/asgard-cfh/pulls/comments/194256722"},"html":{"href":"https://github.com/andela/asgard-cfh/pull/14#discussion_r194256722"},"pull_request":{"href":"https://api.github.com/repos/andela/asgard-cfh/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/andela/asgard-cfh/pulls/14","id":193775624,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNzc1NjI0","html_url":"https://github.com/andela/asgard-cfh/pull/14","diff_url":"https://github.com/andela/asgard-cfh/pull/14.diff","patch_url":"https://github.com/andela/asgard-cfh/pull/14.patch","issue_url":"https://api.github.com/repos/andela/asgard-cfh/issues/14","number":14,"state":"open","locked":false,"title":"Ft game invitation completion #157801293","user":{"login":"OlatunjiYso","id":27797745,"node_id":"MDQ6VXNlcjI3Nzk3NzQ1","avatar_url":"https://avatars3.githubusercontent.com/u/27797745?v=4","gravatar_id":"","url":"https://api.github.com/users/OlatunjiYso","html_url":"https://github.com/OlatunjiYso","followers_url":"https://api.github.com/users/OlatunjiYso/followers","following_url":"https://api.github.com/users/OlatunjiYso/following{/other_user}","gists_url":"https://api.github.com/users/OlatunjiYso/gists{/gist_id}","starred_url":"https://api.github.com/users/OlatunjiYso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlatunjiYso/subscriptions","organizations_url":"https://api.github.com/users/OlatunjiYso/orgs","repos_url":"https://api.github.com/users/OlatunjiYso/repos","events_url":"https://api.github.com/users/OlatunjiYso/events{/privacy}","received_events_url":"https://api.github.com/users/OlatunjiYso/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n- This pull request integrates the implementation of user invitation feature.\r\n- This PR allows users find fellow registered gamers on the platform\r\n- This PR allows sending invitations to other users to join an on-going game.\r\n\r\n#### Description of Task to be completed?\r\n- Searching for desired users\r\n- sending of invitation to users\r\n- displaying invitation status\r\n\r\n#### How should this be manually tested?\r\n- clone the repository and install all dependencies\r\n- navigate to localhost:3000 on your preferred browser\r\n- go ahead to start a game and invite friends. \r\n\r\n#### What are the relevant pivotal tracker stories?\r\n[pivotaltrackerStory](https://www.pivotaltracker.com/n/projects/2173231)\r\n\r\n#### Screenshots (if appropriate)\r\n<img width=\"922\" alt=\"screen shot 2018-06-09 at 11 59 45 am\" src=\"https://user-images.githubusercontent.com/27797745/41191583-d0ec4464-6be9-11e8-8be4-a6341e9be90f.png\">\r\n<img width=\"464\" alt=\"screen shot 2018-06-09 at 12 00 41 pm\" src=\"https://user-images.githubusercontent.com/27797745/41191584-d792a7c2-6be9-11e8-89fa-2b906dddd777.png\">\r\n<img width=\"669\" alt=\"screen shot 2018-06-09 at 12 00 58 pm\" src=\"https://user-images.githubusercontent.com/27797745/41191585-e29c9506-6be9-11e8-973c-b2caa027de54.png\">\r\n\r\n\r\n\r\n","created_at":"2018-06-09T12:35:20Z","updated_at":"2018-06-10T13:07:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f76e57e019caed2a58443117e7fbc23f5ebfedb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/asgard-cfh/pulls/14/commits","review_comments_url":"https://api.github.com/repos/andela/asgard-cfh/pulls/14/comments","review_comment_url":"https://api.github.com/repos/andela/asgard-cfh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/asgard-cfh/issues/14/comments","statuses_url":"https://api.github.com/repos/andela/asgard-cfh/statuses/4be6dd87ef70e491ceade264353950e99ecb2d34","head":{"label":"andela:ft-game-invitation-completion-#157801293","ref":"ft-game-invitation-completion-#157801293","sha":"4be6dd87ef70e491ceade264353950e99ecb2d34","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":134254161,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQyNTQxNjE=","name":"asgard-cfh","full_name":"andela/asgard-cfh","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/asgard-cfh","description":null,"fork":false,"url":"https://api.github.com/repos/andela/asgard-cfh","forks_url":"https://api.github.com/repos/andela/asgard-cfh/forks","keys_url":"https://api.github.com/repos/andela/asgard-cfh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/asgard-cfh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/asgard-cfh/teams","hooks_url":"https://api.github.com/repos/andela/asgard-cfh/hooks","issue_events_url":"https://api.github.com/repos/andela/asgard-cfh/issues/events{/number}","events_url":"https://api.github.com/repos/andela/asgard-cfh/events","assignees_url":"https://api.github.com/repos/andela/asgard-cfh/assignees{/user}","branches_url":"https://api.github.com/repos/andela/asgard-cfh/branches{/branch}","tags_url":"https://api.github.com/repos/andela/asgard-cfh/tags","blobs_url":"https://api.github.com/repos/andela/asgard-cfh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/asgard-cfh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/asgard-cfh/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/asgard-cfh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/asgard-cfh/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/asgard-cfh/languages","stargazers_url":"https://api.github.com/repos/andela/asgard-cfh/stargazers","contributors_url":"https://api.github.com/repos/andela/asgard-cfh/contributors","subscribers_url":"https://api.github.com/repos/andela/asgard-cfh/subscribers","subscription_url":"https://api.github.com/repos/andela/asgard-cfh/subscription","commits_url":"https://api.github.com/repos/andela/asgard-cfh/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/asgard-cfh/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/asgard-cfh/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/asgard-cfh/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/asgard-cfh/contents/{+path}","compare_url":"https://api.github.com/repos/andela/asgard-cfh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/asgard-cfh/merges","archive_url":"https://api.github.com/repos/andela/asgard-cfh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/asgard-cfh/downloads","issues_url":"https://api.github.com/repos/andela/asgard-cfh/issues{/number}","pulls_url":"https://api.github.com/repos/andela/asgard-cfh/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/asgard-cfh/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/asgard-cfh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/asgard-cfh/labels{/name}","releases_url":"https://api.github.com/repos/andela/asgard-cfh/releases{/id}","deployments_url":"https://api.github.com/repos/andela/asgard-cfh/deployments","created_at":"2018-05-21T10:28:05Z","updated_at":"2018-05-28T16:45:55Z","pushed_at":"2018-06-09T21:26:41Z","git_url":"git://github.com/andela/asgard-cfh.git","ssh_url":"git@github.com:andela/asgard-cfh.git","clone_url":"https://github.com/andela/asgard-cfh.git","svn_url":"https://github.com/andela/asgard-cfh","homepage":null,"size":14510,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"andela:develop","ref":"develop","sha":"aa3ac11124a626dc374e2422b78e7e7936190e78","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":134254161,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQyNTQxNjE=","name":"asgard-cfh","full_name":"andela/asgard-cfh","owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/asgard-cfh","description":null,"fork":false,"url":"https://api.github.com/repos/andela/asgard-cfh","forks_url":"https://api.github.com/repos/andela/asgard-cfh/forks","keys_url":"https://api.github.com/repos/andela/asgard-cfh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/asgard-cfh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/asgard-cfh/teams","hooks_url":"https://api.github.com/repos/andela/asgard-cfh/hooks","issue_events_url":"https://api.github.com/repos/andela/asgard-cfh/issues/events{/number}","events_url":"https://api.github.com/repos/andela/asgard-cfh/events","assignees_url":"https://api.github.com/repos/andela/asgard-cfh/assignees{/user}","branches_url":"https://api.github.com/repos/andela/asgard-cfh/branches{/branch}","tags_url":"https://api.github.com/repos/andela/asgard-cfh/tags","blobs_url":"https://api.github.com/repos/andela/asgard-cfh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/asgard-cfh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/asgard-cfh/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/asgard-cfh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/asgard-cfh/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/asgard-cfh/languages","stargazers_url":"https://api.github.com/repos/andela/asgard-cfh/stargazers","contributors_url":"https://api.github.com/repos/andela/asgard-cfh/contributors","subscribers_url":"https://api.github.com/repos/andela/asgard-cfh/subscribers","subscription_url":"https://api.github.com/repos/andela/asgard-cfh/subscription","commits_url":"https://api.github.com/repos/andela/asgard-cfh/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/asgard-cfh/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/asgard-cfh/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/asgard-cfh/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/asgard-cfh/contents/{+path}","compare_url":"https://api.github.com/repos/andela/asgard-cfh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/asgard-cfh/merges","archive_url":"https://api.github.com/repos/andela/asgard-cfh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/asgard-cfh/downloads","issues_url":"https://api.github.com/repos/andela/asgard-cfh/issues{/number}","pulls_url":"https://api.github.com/repos/andela/asgard-cfh/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/asgard-cfh/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/asgard-cfh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/asgard-cfh/labels{/name}","releases_url":"https://api.github.com/repos/andela/asgard-cfh/releases{/id}","deployments_url":"https://api.github.com/repos/andela/asgard-cfh/deployments","created_at":"2018-05-21T10:28:05Z","updated_at":"2018-05-28T16:45:55Z","pushed_at":"2018-06-09T21:26:41Z","git_url":"git://github.com/andela/asgard-cfh.git","ssh_url":"git@github.com:andela/asgard-cfh.git","clone_url":"https://github.com/andela/asgard-cfh.git","svn_url":"https://github.com/andela/asgard-cfh","homepage":null,"size":14510,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/asgard-cfh/pulls/14"},"html":{"href":"https://github.com/andela/asgard-cfh/pull/14"},"issue":{"href":"https://api.github.com/repos/andela/asgard-cfh/issues/14"},"comments":{"href":"https://api.github.com/repos/andela/asgard-cfh/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/asgard-cfh/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/asgard-cfh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/asgard-cfh/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/andela/asgard-cfh/statuses/4be6dd87ef70e491ceade264353950e99ecb2d34"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"fortunee"}}