payload: {"action":"created","comment":{"url":"https://api.github.com/repos/foam-framework/foam2/pulls/comments/283101503","pull_request_review_id":236382240,"id":283101503,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4MzEwMTUwMw==","diff_hunk":"@@ -72,7 +70,7 @@ protected void notifySupport(String query) {\n     emailMessage.setSubject (\"Unknown Country\");\n     emailMessage.setBody    (\"User just added an unknown country \" + query);\n     emailMessage.setTo(new String[]{\"ops@nanopay.net\"});\n-    emailService.sendEmail(getX(), emailMessage);\n+    EmailsUtility.sendEmailFromTemplate(getX(), null, emailMessage, null, null);","path":"src/foam/nanos/auth/CountryService.java","position":27,"original_position":27,"commit_id":"68e279b090af175a987bf8260c793937660c6883","original_commit_id":"68e279b090af175a987bf8260c793937660c6883","user":{"login":"mcarcaso","id":8106568,"node_id":"MDQ6VXNlcjgxMDY1Njg=","avatar_url":"https://avatars0.githubusercontent.com/u/8106568?v=4","gravatar_id":"","url":"https://api.github.com/users/mcarcaso","html_url":"https://github.com/mcarcaso","followers_url":"https://api.github.com/users/mcarcaso/followers","following_url":"https://api.github.com/users/mcarcaso/following{/other_user}","gists_url":"https://api.github.com/users/mcarcaso/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarcaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarcaso/subscriptions","organizations_url":"https://api.github.com/users/mcarcaso/orgs","repos_url":"https://api.github.com/users/mcarcaso/repos","events_url":"https://api.github.com/users/mcarcaso/events{/privacy}","received_events_url":"https://api.github.com/users/mcarcaso/received_events","type":"User","site_admin":false},"body":"Sorry I didn't notice that we were using this to send non-templated emails. I think this design still needs a little work but at least we're in a better state than before so let's roll with this given the current time crunch. Please file a task to revisit this and remove the use of this utility class in favour of a service that knows how to send emails given a template. We'll have to think about that interface a little but we'll tackle that later.","created_at":"2019-05-11T15:47:35Z","updated_at":"2019-05-11T15:47:36Z","html_url":"https://github.com/foam-framework/foam2/pull/1997#discussion_r283101503","pull_request_url":"https://api.github.com/repos/foam-framework/foam2/pulls/1997","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/comments/283101503"},"html":{"href":"https://github.com/foam-framework/foam2/pull/1997#discussion_r283101503"},"pull_request":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1997"}}},"pull_request":{"url":"https://api.github.com/repos/foam-framework/foam2/pulls/1997","id":265761795,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY1NzYxNzk1","html_url":"https://github.com/foam-framework/foam2/pull/1997","diff_url":"https://github.com/foam-framework/foam2/pull/1997.diff","patch_url":"https://github.com/foam-framework/foam2/pull/1997.patch","issue_url":"https://api.github.com/repos/foam-framework/foam2/issues/1997","number":1997,"state":"open","locked":false,"title":"V2.1 email refactor","user":{"login":"Nauna","id":10802216,"node_id":"MDQ6VXNlcjEwODAyMjE2","avatar_url":"https://avatars2.githubusercontent.com/u/10802216?v=4","gravatar_id":"","url":"https://api.github.com/users/Nauna","html_url":"https://github.com/Nauna","followers_url":"https://api.github.com/users/Nauna/followers","following_url":"https://api.github.com/users/Nauna/following{/other_user}","gists_url":"https://api.github.com/users/Nauna/gists{/gist_id}","starred_url":"https://api.github.com/users/Nauna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nauna/subscriptions","organizations_url":"https://api.github.com/users/Nauna/orgs","repos_url":"https://api.github.com/users/Nauna/repos","events_url":"https://api.github.com/users/Nauna/events{/privacy}","received_events_url":"https://api.github.com/users/Nauna/received_events","type":"User","site_admin":false},"body":"Related to : https://github.com/foam-framework/foam2/pull/1945\r\n\r\n\r\nDescription:\r\nEmailsUtility.java is the default class that is the developers class to call. Examples of this usage are in the files listed under ```Code Change```.\r\nThe EmailsUtility then after processing all the properties - passes the emailMessage through to the email pipeline. \r\nEmail Pipeline begins with the emailMessageDAO(service) which has two responsibilities(EmailServiceDAO.js). One it stores the emailMessage in a journal and two it passes the emailMessage to the next service in the pipeline.\r\nThe second service after emailMessageDAO is the email(service). This default service in FOAM is the NullEmailService, and in nanopay is the SMTPEmailService.\r\n\r\n### List of File Changes :\r\n#### Refactored Architect changes:\r\n-```src/foam/nanos/notification/email/EmailServiceDAO.js : ``` Decorator on emailMessage(service) that passes the emailMessage(eM) to the emailService and stores eM into journal.\r\n-```src/foam/nanos/notification/email/DAOEmailService.js :``` removed\r\n-```src/foam/nanos/notification/email/EmailService.js :``` simplified to only have one method\r\n-```src/foam/nanos/notification/email/EmailTemplate.js :``` added functions to handle setting default properties to an emailMessage\r\n-```src/foam/util/email/EmailsUtility.java :``` the static utility functions that are needed for the population of properties and error checking prior a put into the email service.\r\n-```src/foam/nanos/app/EmailConfig :``` adding default properties for emails.\r\n-```src/foam/nanos/notification/email/SMTPEmailService.js :``` clean up to handle only the mimeMessage and transport of emailMessage\r\n-```src/foam/nanos/notification/email/NullEmailService.js :``` since extends EmailService, needed to be simplified to one method override.\r\n-```src/foam/nanos/notification/email/services.jrl```\r\n-```tools/classes.js```\r\n\r\n#### Code Change: Changes to email service calls based on above file refactor\r\n-```src/foam/nanos/auth/email/EmailDocService.js```\r\n-```src/foam/nanos/auth/email/EmailTokenService.js```\r\n-```src/foam/nanos/auth/resetPassword/ResetPasswordTokenService.js```\r\n-```src/foam/nanos/notification/SendEmailNotificationDAO.java```\r\n\r\n#### Clean UP: Changes to email service calls based on above file refactor\r\n-```src/foam/nanos/auth/email/EmailVerificationWebAgent.java```\r\n-```src/foam/nanos/auth/twofactor/GoogleTOTPAuthService.js :``` changes to account for the SMTPEmailService not existing on default.\r\n-```src/foam/nanos/notification/email/scripts.jrl```","created_at":"2019-03-29T15:29:58Z","updated_at":"2019-05-11T15:47:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3222615b137eca83cd9eee8bc8da4068477ded85","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1026634405,"node_id":"MDU6TGFiZWwxMDI2NjM0NDA1","url":"https://api.github.com/repos/foam-framework/foam2/labels/cla:%20no","name":"cla: no","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/foam-framework/foam2/pulls/1997/commits","review_comments_url":"https://api.github.com/repos/foam-framework/foam2/pulls/1997/comments","review_comment_url":"https://api.github.com/repos/foam-framework/foam2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/foam-framework/foam2/issues/1997/comments","statuses_url":"https://api.github.com/repos/foam-framework/foam2/statuses/68e279b090af175a987bf8260c793937660c6883","head":{"label":"Nauna:v2.1EmailRefactor","ref":"v2.1EmailRefactor","sha":"68e279b090af175a987bf8260c793937660c6883","user":{"login":"Nauna","id":10802216,"node_id":"MDQ6VXNlcjEwODAyMjE2","avatar_url":"https://avatars2.githubusercontent.com/u/10802216?v=4","gravatar_id":"","url":"https://api.github.com/users/Nauna","html_url":"https://github.com/Nauna","followers_url":"https://api.github.com/users/Nauna/followers","following_url":"https://api.github.com/users/Nauna/following{/other_user}","gists_url":"https://api.github.com/users/Nauna/gists{/gist_id}","starred_url":"https://api.github.com/users/Nauna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nauna/subscriptions","organizations_url":"https://api.github.com/users/Nauna/orgs","repos_url":"https://api.github.com/users/Nauna/repos","events_url":"https://api.github.com/users/Nauna/events{/privacy}","received_events_url":"https://api.github.com/users/Nauna/received_events","type":"User","site_admin":false},"repo":{"id":138905291,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5MDUyOTE=","name":"foam2","full_name":"Nauna/foam2","private":false,"owner":{"login":"Nauna","id":10802216,"node_id":"MDQ6VXNlcjEwODAyMjE2","avatar_url":"https://avatars2.githubusercontent.com/u/10802216?v=4","gravatar_id":"","url":"https://api.github.com/users/Nauna","html_url":"https://github.com/Nauna","followers_url":"https://api.github.com/users/Nauna/followers","following_url":"https://api.github.com/users/Nauna/following{/other_user}","gists_url":"https://api.github.com/users/Nauna/gists{/gist_id}","starred_url":"https://api.github.com/users/Nauna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nauna/subscriptions","organizations_url":"https://api.github.com/users/Nauna/orgs","repos_url":"https://api.github.com/users/Nauna/repos","events_url":"https://api.github.com/users/Nauna/events{/privacy}","received_events_url":"https://api.github.com/users/Nauna/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Nauna/foam2","description":"FOAM: Feature-Oriented Active Modeller, Version 2","fork":true,"url":"https://api.github.com/repos/Nauna/foam2","forks_url":"https://api.github.com/repos/Nauna/foam2/forks","keys_url":"https://api.github.com/repos/Nauna/foam2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nauna/foam2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nauna/foam2/teams","hooks_url":"https://api.github.com/repos/Nauna/foam2/hooks","issue_events_url":"https://api.github.com/repos/Nauna/foam2/issues/events{/number}","events_url":"https://api.github.com/repos/Nauna/foam2/events","assignees_url":"https://api.github.com/repos/Nauna/foam2/assignees{/user}","branches_url":"https://api.github.com/repos/Nauna/foam2/branches{/branch}","tags_url":"https://api.github.com/repos/Nauna/foam2/tags","blobs_url":"https://api.github.com/repos/Nauna/foam2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nauna/foam2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nauna/foam2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nauna/foam2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nauna/foam2/statuses/{sha}","languages_url":"https://api.github.com/repos/Nauna/foam2/languages","stargazers_url":"https://api.github.com/repos/Nauna/foam2/stargazers","contributors_url":"https://api.github.com/repos/Nauna/foam2/contributors","subscribers_url":"https://api.github.com/repos/Nauna/foam2/subscribers","subscription_url":"https://api.github.com/repos/Nauna/foam2/subscription","commits_url":"https://api.github.com/repos/Nauna/foam2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nauna/foam2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nauna/foam2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nauna/foam2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nauna/foam2/contents/{+path}","compare_url":"https://api.github.com/repos/Nauna/foam2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nauna/foam2/merges","archive_url":"https://api.github.com/repos/Nauna/foam2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nauna/foam2/downloads","issues_url":"https://api.github.com/repos/Nauna/foam2/issues{/number}","pulls_url":"https://api.github.com/repos/Nauna/foam2/pulls{/number}","milestones_url":"https://api.github.com/repos/Nauna/foam2/milestones{/number}","notifications_url":"https://api.github.com/repos/Nauna/foam2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nauna/foam2/labels{/name}","releases_url":"https://api.github.com/repos/Nauna/foam2/releases{/id}","deployments_url":"https://api.github.com/repos/Nauna/foam2/deployments","created_at":"2018-06-27T16:15:24Z","updated_at":"2019-04-09T16:00:38Z","pushed_at":"2019-05-11T14:11:44Z","git_url":"git://github.com/Nauna/foam2.git","ssh_url":"git@github.com:Nauna/foam2.git","clone_url":"https://github.com/Nauna/foam2.git","svn_url":"https://github.com/Nauna/foam2","homepage":"","size":32241,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"foam-framework:master","ref":"master","sha":"4ff604c2e2788cfc4c8261b5a78e9b70b69c2442","user":{"login":"foam-framework","id":7460756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NjA3NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7460756?v=4","gravatar_id":"","url":"https://api.github.com/users/foam-framework","html_url":"https://github.com/foam-framework","followers_url":"https://api.github.com/users/foam-framework/followers","following_url":"https://api.github.com/users/foam-framework/following{/other_user}","gists_url":"https://api.github.com/users/foam-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/foam-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foam-framework/subscriptions","organizations_url":"https://api.github.com/users/foam-framework/orgs","repos_url":"https://api.github.com/users/foam-framework/repos","events_url":"https://api.github.com/users/foam-framework/events{/privacy}","received_events_url":"https://api.github.com/users/foam-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":50441060,"node_id":"MDEwOlJlcG9zaXRvcnk1MDQ0MTA2MA==","name":"foam2","full_name":"foam-framework/foam2","private":false,"owner":{"login":"foam-framework","id":7460756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0NjA3NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7460756?v=4","gravatar_id":"","url":"https://api.github.com/users/foam-framework","html_url":"https://github.com/foam-framework","followers_url":"https://api.github.com/users/foam-framework/followers","following_url":"https://api.github.com/users/foam-framework/following{/other_user}","gists_url":"https://api.github.com/users/foam-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/foam-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foam-framework/subscriptions","organizations_url":"https://api.github.com/users/foam-framework/orgs","repos_url":"https://api.github.com/users/foam-framework/repos","events_url":"https://api.github.com/users/foam-framework/events{/privacy}","received_events_url":"https://api.github.com/users/foam-framework/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/foam-framework/foam2","description":"FOAM: Feature-Oriented Active Modeller, Version 2","fork":false,"url":"https://api.github.com/repos/foam-framework/foam2","forks_url":"https://api.github.com/repos/foam-framework/foam2/forks","keys_url":"https://api.github.com/repos/foam-framework/foam2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foam-framework/foam2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foam-framework/foam2/teams","hooks_url":"https://api.github.com/repos/foam-framework/foam2/hooks","issue_events_url":"https://api.github.com/repos/foam-framework/foam2/issues/events{/number}","events_url":"https://api.github.com/repos/foam-framework/foam2/events","assignees_url":"https://api.github.com/repos/foam-framework/foam2/assignees{/user}","branches_url":"https://api.github.com/repos/foam-framework/foam2/branches{/branch}","tags_url":"https://api.github.com/repos/foam-framework/foam2/tags","blobs_url":"https://api.github.com/repos/foam-framework/foam2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foam-framework/foam2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foam-framework/foam2/git/refs{/sha}","trees_url":"https://api.github.com/repos/foam-framework/foam2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foam-framework/foam2/statuses/{sha}","languages_url":"https://api.github.com/repos/foam-framework/foam2/languages","stargazers_url":"https://api.github.com/repos/foam-framework/foam2/stargazers","contributors_url":"https://api.github.com/repos/foam-framework/foam2/contributors","subscribers_url":"https://api.github.com/repos/foam-framework/foam2/subscribers","subscription_url":"https://api.github.com/repos/foam-framework/foam2/subscription","commits_url":"https://api.github.com/repos/foam-framework/foam2/commits{/sha}","git_commits_url":"https://api.github.com/repos/foam-framework/foam2/git/commits{/sha}","comments_url":"https://api.github.com/repos/foam-framework/foam2/comments{/number}","issue_comment_url":"https://api.github.com/repos/foam-framework/foam2/issues/comments{/number}","contents_url":"https://api.github.com/repos/foam-framework/foam2/contents/{+path}","compare_url":"https://api.github.com/repos/foam-framework/foam2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foam-framework/foam2/merges","archive_url":"https://api.github.com/repos/foam-framework/foam2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foam-framework/foam2/downloads","issues_url":"https://api.github.com/repos/foam-framework/foam2/issues{/number}","pulls_url":"https://api.github.com/repos/foam-framework/foam2/pulls{/number}","milestones_url":"https://api.github.com/repos/foam-framework/foam2/milestones{/number}","notifications_url":"https://api.github.com/repos/foam-framework/foam2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foam-framework/foam2/labels{/name}","releases_url":"https://api.github.com/repos/foam-framework/foam2/releases{/id}","deployments_url":"https://api.github.com/repos/foam-framework/foam2/deployments","created_at":"2016-01-26T16:13:38Z","updated_at":"2019-05-11T00:34:50Z","pushed_at":"2019-05-11T14:11:45Z","git_url":"git://github.com/foam-framework/foam2.git","ssh_url":"git@github.com:foam-framework/foam2.git","clone_url":"https://github.com/foam-framework/foam2.git","svn_url":"https://github.com/foam-framework/foam2","homepage":"","size":31695,"stargazers_count":40,"watchers_count":40,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":54,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":198,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":54,"open_issues":198,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1997"},"html":{"href":"https://github.com/foam-framework/foam2/pull/1997"},"issue":{"href":"https://api.github.com/repos/foam-framework/foam2/issues/1997"},"comments":{"href":"https://api.github.com/repos/foam-framework/foam2/issues/1997/comments"},"review_comments":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1997/comments"},"review_comment":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/foam-framework/foam2/pulls/1997/commits"},"statuses":{"href":"https://api.github.com/repos/foam-framework/foam2/statuses/68e279b090af175a987bf8260c793937660c6883"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"mcarcaso"}}