{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/comments/30623137","id":30623137,"diff_hunk":"@@ -14,39 +14,32 @@ def summary(options = {})\n     total = 0\n     total_metrics.values.each { |v| total += v }\n \n-    subject = _(\"Puppet Summary Report - F:%{failed} R:%{restarted} S:%{skipped} A:%{applied} FR:%{failed_restarts} T:%{total}\") % {\n-      :failed => total_metrics[\"failed\"],\n-      :restarted => total_metrics[\"restarted\"],\n-      :skipped => total_metrics[\"skipped\"],\n-      :applied => total_metrics[\"applied\"],\n-      :failed_restarts => total_metrics[\"failed_restarts\"],\n-      :total => total\n-    }\n-\n     @hosts = host_data\n     @timerange = time\n     @out_of_sync = hosts.out_of_sync\n     @disabled = hosts.alerts_disabled\n-\n     set_url\n-    set_locale_for user\n \n-    mail(:to   => user.mail,\n-         :from => Setting[\"email_reply_address\"],\n-         :subject => subject,\n-         :date => Time.zone.now )\n+    set_locale_for(user) do\n+      subject = _(\"Puppet Summary Report - F:%{failed} R:%{restarted} S:%{skipped} A:%{applied} FR:%{failed_restarts} T:%{total}\") % {\n+        :failed => total_metrics[\"failed\"],\n+        :restarted => total_metrics[\"restarted\"],\n+        :skipped => total_metrics[\"skipped\"],\n+        :applied => total_metrics[\"applied\"],\n+        :failed_restarts => total_metrics[\"failed_restarts\"],\n+        :total => total\n+      }","path":"app/mailers/host_mailer.rb","position":33,"original_position":33,"commit_id":"46481eb9e4ce598d3257925882d7e3525ebe8c19","original_commit_id":"46481eb9e4ce598d3257925882d7e3525ebe8c19","user":{"login":"stbenjam","id":429763,"avatar_url":"https://avatars.githubusercontent.com/u/429763?v=3","gravatar_id":"","url":"https://api.github.com/users/stbenjam","html_url":"https://github.com/stbenjam","followers_url":"https://api.github.com/users/stbenjam/followers","following_url":"https://api.github.com/users/stbenjam/following{/other_user}","gists_url":"https://api.github.com/users/stbenjam/gists{/gist_id}","starred_url":"https://api.github.com/users/stbenjam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stbenjam/subscriptions","organizations_url":"https://api.github.com/users/stbenjam/orgs","repos_url":"https://api.github.com/users/stbenjam/repos","events_url":"https://api.github.com/users/stbenjam/events{/privacy}","received_events_url":"https://api.github.com/users/stbenjam/received_events","type":"User","site_admin":false},"body":"Would it be faster to build the substitution hash outside of the block so it's done only once?","created_at":"2015-05-19T17:19:06Z","updated_at":"2015-05-19T17:19:06Z","html_url":"https://github.com/theforeman/foreman/pull/2314#discussion_r30623137","pull_request_url":"https://api.github.com/repos/theforeman/foreman/pulls/2314","_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments/30623137"},"html":{"href":"https://github.com/theforeman/foreman/pull/2314#discussion_r30623137"},"pull_request":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2314"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/foreman/pulls/2314","id":33832302,"html_url":"https://github.com/theforeman/foreman/pull/2314","diff_url":"https://github.com/theforeman/foreman/pull/2314.diff","patch_url":"https://github.com/theforeman/foreman/pull/2314.patch","issue_url":"https://api.github.com/repos/theforeman/foreman/issues/2314","number":2314,"state":"open","locked":false,"title":"fixes #9873 - generate unique alert mails for each user group member","user":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"body":"To create distinct mails, new Mailer instances are required instead of using\r\nthe same one - else, the last message changes the previous ones.  The recipient\r\nlist is now determined in the ReportImporter, and the MailNotification helps\r\ncreate Mailers for each recipient.\r\n\r\nThe locale is also set correctly for each recipient this way, ensuring their\r\nsubject lines are now also translated.","created_at":"2015-04-22T07:26:21Z","updated_at":"2015-05-19T17:19:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35ea0190211b4f62c6feb50fea89e680b29bf08b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/foreman/pulls/2314/commits","review_comments_url":"https://api.github.com/repos/theforeman/foreman/pulls/2314/comments","review_comment_url":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/foreman/issues/2314/comments","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/46481eb9e4ce598d3257925882d7e3525ebe8c19","head":{"label":"domcleal:9873-mail-group","ref":"9873-mail-group","sha":"46481eb9e4ce598d3257925882d7e3525ebe8c19","user":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"repo":{"id":6577737,"name":"foreman","full_name":"domcleal/foreman","owner":{"login":"domcleal","id":482089,"avatar_url":"https://avatars.githubusercontent.com/u/482089?v=3","gravatar_id":"","url":"https://api.github.com/users/domcleal","html_url":"https://github.com/domcleal","followers_url":"https://api.github.com/users/domcleal/followers","following_url":"https://api.github.com/users/domcleal/following{/other_user}","gists_url":"https://api.github.com/users/domcleal/gists{/gist_id}","starred_url":"https://api.github.com/users/domcleal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domcleal/subscriptions","organizations_url":"https://api.github.com/users/domcleal/orgs","repos_url":"https://api.github.com/users/domcleal/repos","events_url":"https://api.github.com/users/domcleal/events{/privacy}","received_events_url":"https://api.github.com/users/domcleal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/domcleal/foreman","description":"an application that automates the lifecycle of servers ","fork":true,"url":"https://api.github.com/repos/domcleal/foreman","forks_url":"https://api.github.com/repos/domcleal/foreman/forks","keys_url":"https://api.github.com/repos/domcleal/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/domcleal/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/domcleal/foreman/teams","hooks_url":"https://api.github.com/repos/domcleal/foreman/hooks","issue_events_url":"https://api.github.com/repos/domcleal/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/domcleal/foreman/events","assignees_url":"https://api.github.com/repos/domcleal/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/domcleal/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/domcleal/foreman/tags","blobs_url":"https://api.github.com/repos/domcleal/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/domcleal/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/domcleal/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/domcleal/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/domcleal/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/domcleal/foreman/languages","stargazers_url":"https://api.github.com/repos/domcleal/foreman/stargazers","contributors_url":"https://api.github.com/repos/domcleal/foreman/contributors","subscribers_url":"https://api.github.com/repos/domcleal/foreman/subscribers","subscription_url":"https://api.github.com/repos/domcleal/foreman/subscription","commits_url":"https://api.github.com/repos/domcleal/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/domcleal/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/domcleal/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/domcleal/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/domcleal/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/domcleal/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/domcleal/foreman/merges","archive_url":"https://api.github.com/repos/domcleal/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/domcleal/foreman/downloads","issues_url":"https://api.github.com/repos/domcleal/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/domcleal/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/domcleal/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/domcleal/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/domcleal/foreman/labels{/name}","releases_url":"https://api.github.com/repos/domcleal/foreman/releases{/id}","created_at":"2012-11-07T10:48:14Z","updated_at":"2014-11-25T12:48:14Z","pushed_at":"2015-05-19T12:28:40Z","git_url":"git://github.com/domcleal/foreman.git","ssh_url":"git@github.com:domcleal/foreman.git","clone_url":"https://github.com/domcleal/foreman.git","svn_url":"https://github.com/domcleal/foreman","homepage":"http://theforeman.org","size":31448,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"0fd7412faaa76787bf15ed1901ffc9eb4d6353fa","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":258750,"name":"foreman","full_name":"theforeman/foreman","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/foreman","description":"an application that automates the lifecycle of servers ","fork":false,"url":"https://api.github.com/repos/theforeman/foreman","forks_url":"https://api.github.com/repos/theforeman/foreman/forks","keys_url":"https://api.github.com/repos/theforeman/foreman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/foreman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/foreman/teams","hooks_url":"https://api.github.com/repos/theforeman/foreman/hooks","issue_events_url":"https://api.github.com/repos/theforeman/foreman/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/foreman/events","assignees_url":"https://api.github.com/repos/theforeman/foreman/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/foreman/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/foreman/tags","blobs_url":"https://api.github.com/repos/theforeman/foreman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/foreman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/foreman/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/foreman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/foreman/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/foreman/languages","stargazers_url":"https://api.github.com/repos/theforeman/foreman/stargazers","contributors_url":"https://api.github.com/repos/theforeman/foreman/contributors","subscribers_url":"https://api.github.com/repos/theforeman/foreman/subscribers","subscription_url":"https://api.github.com/repos/theforeman/foreman/subscription","commits_url":"https://api.github.com/repos/theforeman/foreman/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/foreman/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/foreman/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/foreman/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/foreman/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/foreman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/foreman/merges","archive_url":"https://api.github.com/repos/theforeman/foreman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/foreman/downloads","issues_url":"https://api.github.com/repos/theforeman/foreman/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/foreman/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/foreman/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/foreman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/foreman/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/foreman/releases{/id}","created_at":"2009-07-23T15:07:00Z","updated_at":"2015-05-18T17:37:26Z","pushed_at":"2015-05-19T16:35:01Z","git_url":"git://github.com/theforeman/foreman.git","ssh_url":"git@github.com:theforeman/foreman.git","clone_url":"https://github.com/theforeman/foreman.git","svn_url":"https://github.com/theforeman/foreman","homepage":"http://theforeman.org","size":84409,"stargazers_count":760,"watchers_count":760,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":395,"mirror_url":null,"open_issues_count":76,"forks":395,"open_issues":76,"watchers":760,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2314"},"html":{"href":"https://github.com/theforeman/foreman/pull/2314"},"issue":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2314"},"comments":{"href":"https://api.github.com/repos/theforeman/foreman/issues/2314/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2314/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/foreman/pulls/2314/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/foreman/statuses/46481eb9e4ce598d3257925882d7e3525ebe8c19"}}}}