{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments/36953023","id":36953023,"diff_hunk":"@@ -73,9 +73,20 @@ public void sendEmail() {\n \n         try {\n             if (this.notification == null) {\n-                throw new NullPointerException(\"Notification not set. Please set the notification before sending messages\");\n+                throw new IllegalStateException(\"Notification not set. \" +\n+                        \"Please set the notification before sending messages\");\n             }\n             PrivilegedCarbonContext.startTenantFlow();\n+            if (notificationData != null) {\n+                String tenantDomain = notificationData.getDomainName();\n+                PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();\n+                carbonContext.setTenantDomain(tenantDomain);\n+                carbonContext.getTenantId(true);","path":"components/identity-mgt/org.wso2.carbon.identity.mgt/src/main/java/org/wso2/carbon/identity/mgt/mail/DefaultEmailSendingModule.java","position":13,"original_position":13,"commit_id":"f845e8bdd53e1a14fe3d4e5da1402844abb38e08","original_commit_id":"f845e8bdd53e1a14fe3d4e5da1402844abb38e08","user":{"login":"nuwandiw","id":10049188,"avatar_url":"https://avatars.githubusercontent.com/u/10049188?v=3","gravatar_id":"","url":"https://api.github.com/users/nuwandiw","html_url":"https://github.com/nuwandiw","followers_url":"https://api.github.com/users/nuwandiw/followers","following_url":"https://api.github.com/users/nuwandiw/following{/other_user}","gists_url":"https://api.github.com/users/nuwandiw/gists{/gist_id}","starred_url":"https://api.github.com/users/nuwandiw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuwandiw/subscriptions","organizations_url":"https://api.github.com/users/nuwandiw/orgs","repos_url":"https://api.github.com/users/nuwandiw/repos","events_url":"https://api.github.com/users/nuwandiw/events{/privacy}","received_events_url":"https://api.github.com/users/nuwandiw/received_events","type":"User","site_admin":false},"body":"Changed to carbonContext.setTenantDomain(tenantDomain, true) in carbonContext.setTenantDomain(tenantDomain, true)","created_at":"2015-08-13T08:56:54Z","updated_at":"2015-08-13T08:56:54Z","html_url":"https://github.com/wso2/carbon-identity/pull/499#discussion_r36953023","pull_request_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/499","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments/36953023"},"html":{"href":"https://github.com/wso2/carbon-identity/pull/499#discussion_r36953023"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/499"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-identity/pulls/499","id":38643697,"html_url":"https://github.com/wso2/carbon-identity/pull/499","diff_url":"https://github.com/wso2/carbon-identity/pull/499.diff","patch_url":"https://github.com/wso2/carbon-identity/pull/499.patch","issue_url":"https://api.github.com/repos/wso2/carbon-identity/issues/499","number":499,"state":"closed","locked":false,"title":"Fix for https://wso2.org/jira/browse/IDENTITY-3371","user":{"login":"nuwandiw","id":10049188,"avatar_url":"https://avatars.githubusercontent.com/u/10049188?v=3","gravatar_id":"","url":"https://api.github.com/users/nuwandiw","html_url":"https://github.com/nuwandiw","followers_url":"https://api.github.com/users/nuwandiw/followers","following_url":"https://api.github.com/users/nuwandiw/following{/other_user}","gists_url":"https://api.github.com/users/nuwandiw/gists{/gist_id}","starred_url":"https://api.github.com/users/nuwandiw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuwandiw/subscriptions","organizations_url":"https://api.github.com/users/nuwandiw/orgs","repos_url":"https://api.github.com/users/nuwandiw/repos","events_url":"https://api.github.com/users/nuwandiw/events{/privacy}","received_events_url":"https://api.github.com/users/nuwandiw/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-26T12:18:47Z","updated_at":"2015-08-13T08:56:54Z","closed_at":"2015-06-26T14:23:19Z","merged_at":"2015-06-26T14:23:19Z","merge_commit_sha":"6a11bed99b914b1207c40f2e428510ba5780622d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/499/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/499/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-identity/issues/499/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-identity/statuses/f845e8bdd53e1a14fe3d4e5da1402844abb38e08","head":{"label":"nuwandi-is:b626","ref":"b626","sha":"f845e8bdd53e1a14fe3d4e5da1402844abb38e08","user":{"login":"nuwandi-is","id":10919367,"avatar_url":"https://avatars.githubusercontent.com/u/10919367?v=3","gravatar_id":"","url":"https://api.github.com/users/nuwandi-is","html_url":"https://github.com/nuwandi-is","followers_url":"https://api.github.com/users/nuwandi-is/followers","following_url":"https://api.github.com/users/nuwandi-is/following{/other_user}","gists_url":"https://api.github.com/users/nuwandi-is/gists{/gist_id}","starred_url":"https://api.github.com/users/nuwandi-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuwandi-is/subscriptions","organizations_url":"https://api.github.com/users/nuwandi-is/orgs","repos_url":"https://api.github.com/users/nuwandi-is/repos","events_url":"https://api.github.com/users/nuwandi-is/events{/privacy}","received_events_url":"https://api.github.com/users/nuwandi-is/received_events","type":"Organization","site_admin":false},"repo":{"id":30525618,"name":"carbon-identity","full_name":"nuwandi-is/carbon-identity","owner":{"login":"nuwandi-is","id":10919367,"avatar_url":"https://avatars.githubusercontent.com/u/10919367?v=3","gravatar_id":"","url":"https://api.github.com/users/nuwandi-is","html_url":"https://github.com/nuwandi-is","followers_url":"https://api.github.com/users/nuwandi-is/followers","following_url":"https://api.github.com/users/nuwandi-is/following{/other_user}","gists_url":"https://api.github.com/users/nuwandi-is/gists{/gist_id}","starred_url":"https://api.github.com/users/nuwandi-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuwandi-is/subscriptions","organizations_url":"https://api.github.com/users/nuwandi-is/orgs","repos_url":"https://api.github.com/users/nuwandi-is/repos","events_url":"https://api.github.com/users/nuwandi-is/events{/privacy}","received_events_url":"https://api.github.com/users/nuwandi-is/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuwandi-is/carbon-identity","description":"","fork":true,"url":"https://api.github.com/repos/nuwandi-is/carbon-identity","forks_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/forks","keys_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/teams","hooks_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/hooks","issue_events_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/issues/events{/number}","events_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/events","assignees_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/assignees{/user}","branches_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/branches{/branch}","tags_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/tags","blobs_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/statuses/{sha}","languages_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/languages","stargazers_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/stargazers","contributors_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/contributors","subscribers_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/subscribers","subscription_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/subscription","commits_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/contents/{+path}","compare_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/merges","archive_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/downloads","issues_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/issues{/number}","pulls_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/pulls{/number}","milestones_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/milestones{/number}","notifications_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/labels{/name}","releases_url":"https://api.github.com/repos/nuwandi-is/carbon-identity/releases{/id}","created_at":"2015-02-09T08:23:04Z","updated_at":"2015-04-08T05:13:14Z","pushed_at":"2015-08-13T08:54:58Z","git_url":"git://github.com/nuwandi-is/carbon-identity.git","ssh_url":"git@github.com:nuwandi-is/carbon-identity.git","clone_url":"https://github.com/nuwandi-is/carbon-identity.git","svn_url":"https://github.com/nuwandi-is/carbon-identity","homepage":null,"size":38144,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"bcc3a7d77fa6ffab5c9bb42865ed97165de99443","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":16588204,"name":"carbon-identity","full_name":"wso2/carbon-identity","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-identity","description":"","fork":false,"url":"https://api.github.com/repos/wso2/carbon-identity","forks_url":"https://api.github.com/repos/wso2/carbon-identity/forks","keys_url":"https://api.github.com/repos/wso2/carbon-identity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-identity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-identity/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-identity/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-identity/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-identity/events","assignees_url":"https://api.github.com/repos/wso2/carbon-identity/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-identity/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-identity/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-identity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-identity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-identity/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-identity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-identity/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-identity/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-identity/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-identity/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-identity/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-identity/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-identity/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-identity/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-identity/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-identity/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-identity/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-identity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-identity/merges","archive_url":"https://api.github.com/repos/wso2/carbon-identity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-identity/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-identity/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-identity/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-identity/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-identity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-identity/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-identity/releases{/id}","created_at":"2014-02-06T17:58:23Z","updated_at":"2015-07-24T18:32:22Z","pushed_at":"2015-08-13T08:54:59Z","git_url":"git://github.com/wso2/carbon-identity.git","ssh_url":"git@github.com:wso2/carbon-identity.git","clone_url":"https://github.com/wso2/carbon-identity.git","svn_url":"https://github.com/wso2/carbon-identity","homepage":null,"size":103221,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":116,"mirror_url":null,"open_issues_count":61,"forks":116,"open_issues":61,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/499"},"html":{"href":"https://github.com/wso2/carbon-identity/pull/499"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-identity/issues/499"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-identity/issues/499/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/499/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-identity/pulls/499/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-identity/statuses/f845e8bdd53e1a14fe3d4e5da1402844abb38e08"}}}}