{"action":"created","comment":{"url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/comments/130054159","pull_request_review_id":52881435,"id":130054159,"diff_hunk":"@@ -0,0 +1,79 @@\n+<?php\n+\n+\n+namespace Azine\\MailgunWebhooksBundle\\Services;\n+\n+use Monolog\\Logger;\n+use Symfony\\Component\\Validator\\Validator\\ValidatorInterface;\n+\n+class AzineMailgunMailerService\n+{\n+    private $mailer;\n+    private $validator;\n+    private $logger;\n+    private $twig;\n+    private $mailerUser;\n+    private $ticketId;\n+    private $ticketSubject;\n+    private $ticketMessage;\n+    private $adminUserEmail;\n+    \n+    public function __construct(\n+        \\Swift_Mailer $mailer,\n+        ValidatorInterface $validator,\n+        Logger $logger,\n+        \\Twig_Environment $twig,\n+        $mailerUser,\n+        $ticketId,\n+        $ticketSubject,\n+        $ticketMessage,\n+        $adminUserEmail\n+    ) {\n+        $this->mailer = $mailer;\n+        $this->validator = $validator;\n+        $this->logger = $logger;\n+        $this->twig = $twig;\n+        $this->mailerUser = $mailerUser;\n+        $this->ticketId = $ticketId;\n+        $this->ticketSubject = $ticketSubject;\n+        $this->ticketMessage = $ticketMessage;\n+        $this->adminUserEmail = $adminUserEmail;\n+    }\n+\n+    public function  sendSpamComplaintNotification($eventId)\n+    {\n+        if (is_null($this->validateEmail($this->adminUserEmail))) {            \n+            /** @var \\Swift_Message $message */\n+            $message = $this->mailer->createMessage();\n+            $message->setTo($this->adminUserEmail)\n+                    ->setFrom($this->mailerUser)\n+                    ->setSubject('Spam complaint received')","path":"Services/AzineMailgunMailerService.php","position":50,"original_position":50,"commit_id":"ff1b2a65acc450e06e1b9a72c16aa2e029efe209","original_commit_id":"ff1b2a65acc450e06e1b9a72c16aa2e029efe209","user":{"login":"azine","id":3774977,"avatar_url":"https://avatars3.githubusercontent.com/u/3774977?v=4","gravatar_id":"","url":"https://api.github.com/users/azine","html_url":"https://github.com/azine","followers_url":"https://api.github.com/users/azine/followers","following_url":"https://api.github.com/users/azine/following{/other_user}","gists_url":"https://api.github.com/users/azine/gists{/gist_id}","starred_url":"https://api.github.com/users/azine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azine/subscriptions","organizations_url":"https://api.github.com/users/azine/orgs","repos_url":"https://api.github.com/users/azine/repos","events_url":"https://api.github.com/users/azine/events{/privacy}","received_events_url":"https://api.github.com/users/azine/received_events","type":"User","site_admin":false},"body":"please use a message-key here and translate it","created_at":"2017-07-28T09:54:37Z","updated_at":"2017-07-28T09:55:16Z","html_url":"https://github.com/azine/AzineMailgunWebhooksBundle/pull/7#discussion_r130054159","pull_request_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/comments/130054159"},"html":{"href":"https://github.com/azine/AzineMailgunWebhooksBundle/pull/7#discussion_r130054159"},"pull_request":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7","id":132924629,"html_url":"https://github.com/azine/AzineMailgunWebhooksBundle/pull/7","diff_url":"https://github.com/azine/AzineMailgunWebhooksBundle/pull/7.diff","patch_url":"https://github.com/azine/AzineMailgunWebhooksBundle/pull/7.patch","issue_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues/7","number":7,"state":"open","locked":false,"title":"Issue/respond to spam events","user":{"login":"thatside-zaraffa","id":25102329,"avatar_url":"https://avatars1.githubusercontent.com/u/25102329?v=4","gravatar_id":"","url":"https://api.github.com/users/thatside-zaraffa","html_url":"https://github.com/thatside-zaraffa","followers_url":"https://api.github.com/users/thatside-zaraffa/followers","following_url":"https://api.github.com/users/thatside-zaraffa/following{/other_user}","gists_url":"https://api.github.com/users/thatside-zaraffa/gists{/gist_id}","starred_url":"https://api.github.com/users/thatside-zaraffa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatside-zaraffa/subscriptions","organizations_url":"https://api.github.com/users/thatside-zaraffa/orgs","repos_url":"https://api.github.com/users/thatside-zaraffa/repos","events_url":"https://api.github.com/users/thatside-zaraffa/events{/privacy}","received_events_url":"https://api.github.com/users/thatside-zaraffa/received_events","type":"User","site_admin":false},"body":"Implemented automatic notifications for adminUser when receiving spam complaints","created_at":"2017-07-28T09:02:32Z","updated_at":"2017-07-28T09:55:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a54c0a54e11b893fb3fdffaec7041219fcb3b7d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7/commits","review_comments_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7/comments","review_comment_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues/7/comments","statuses_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/statuses/ff1b2a65acc450e06e1b9a72c16aa2e029efe209","head":{"label":"thatside-zaraffa:issue/respond_to_spam_events","ref":"issue/respond_to_spam_events","sha":"ff1b2a65acc450e06e1b9a72c16aa2e029efe209","user":{"login":"thatside-zaraffa","id":25102329,"avatar_url":"https://avatars1.githubusercontent.com/u/25102329?v=4","gravatar_id":"","url":"https://api.github.com/users/thatside-zaraffa","html_url":"https://github.com/thatside-zaraffa","followers_url":"https://api.github.com/users/thatside-zaraffa/followers","following_url":"https://api.github.com/users/thatside-zaraffa/following{/other_user}","gists_url":"https://api.github.com/users/thatside-zaraffa/gists{/gist_id}","starred_url":"https://api.github.com/users/thatside-zaraffa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatside-zaraffa/subscriptions","organizations_url":"https://api.github.com/users/thatside-zaraffa/orgs","repos_url":"https://api.github.com/users/thatside-zaraffa/repos","events_url":"https://api.github.com/users/thatside-zaraffa/events{/privacy}","received_events_url":"https://api.github.com/users/thatside-zaraffa/received_events","type":"User","site_admin":false},"repo":{"id":97232949,"name":"AzineMailgunWebhooksBundle","full_name":"thatside-zaraffa/AzineMailgunWebhooksBundle","owner":{"login":"thatside-zaraffa","id":25102329,"avatar_url":"https://avatars1.githubusercontent.com/u/25102329?v=4","gravatar_id":"","url":"https://api.github.com/users/thatside-zaraffa","html_url":"https://github.com/thatside-zaraffa","followers_url":"https://api.github.com/users/thatside-zaraffa/followers","following_url":"https://api.github.com/users/thatside-zaraffa/following{/other_user}","gists_url":"https://api.github.com/users/thatside-zaraffa/gists{/gist_id}","starred_url":"https://api.github.com/users/thatside-zaraffa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatside-zaraffa/subscriptions","organizations_url":"https://api.github.com/users/thatside-zaraffa/orgs","repos_url":"https://api.github.com/users/thatside-zaraffa/repos","events_url":"https://api.github.com/users/thatside-zaraffa/events{/privacy}","received_events_url":"https://api.github.com/users/thatside-zaraffa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thatside-zaraffa/AzineMailgunWebhooksBundle","description":"Symfony2 Bundle to easily capture feedback from mailgun.com via their provided webhooks","fork":true,"url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle","forks_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/forks","keys_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/teams","hooks_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/hooks","issue_events_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/issues/events{/number}","events_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/events","assignees_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/assignees{/user}","branches_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/branches{/branch}","tags_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/tags","blobs_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/languages","stargazers_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/stargazers","contributors_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/contributors","subscribers_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/subscribers","subscription_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/subscription","commits_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/contents/{+path}","compare_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/merges","archive_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/downloads","issues_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/issues{/number}","pulls_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/labels{/name}","releases_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/releases{/id}","deployments_url":"https://api.github.com/repos/thatside-zaraffa/AzineMailgunWebhooksBundle/deployments","created_at":"2017-07-14T12:45:56Z","updated_at":"2017-07-14T12:45:57Z","pushed_at":"2017-07-28T09:02:13Z","git_url":"git://github.com/thatside-zaraffa/AzineMailgunWebhooksBundle.git","ssh_url":"git@github.com:thatside-zaraffa/AzineMailgunWebhooksBundle.git","clone_url":"https://github.com/thatside-zaraffa/AzineMailgunWebhooksBundle.git","svn_url":"https://github.com/thatside-zaraffa/AzineMailgunWebhooksBundle","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"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":"master"}},"base":{"label":"azine:master","ref":"master","sha":"265537b7902577f64e10e3066caba2a7fc71f477","user":{"login":"azine","id":3774977,"avatar_url":"https://avatars3.githubusercontent.com/u/3774977?v=4","gravatar_id":"","url":"https://api.github.com/users/azine","html_url":"https://github.com/azine","followers_url":"https://api.github.com/users/azine/followers","following_url":"https://api.github.com/users/azine/following{/other_user}","gists_url":"https://api.github.com/users/azine/gists{/gist_id}","starred_url":"https://api.github.com/users/azine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azine/subscriptions","organizations_url":"https://api.github.com/users/azine/orgs","repos_url":"https://api.github.com/users/azine/repos","events_url":"https://api.github.com/users/azine/events{/privacy}","received_events_url":"https://api.github.com/users/azine/received_events","type":"User","site_admin":false},"repo":{"id":15286136,"name":"AzineMailgunWebhooksBundle","full_name":"azine/AzineMailgunWebhooksBundle","owner":{"login":"azine","id":3774977,"avatar_url":"https://avatars3.githubusercontent.com/u/3774977?v=4","gravatar_id":"","url":"https://api.github.com/users/azine","html_url":"https://github.com/azine","followers_url":"https://api.github.com/users/azine/followers","following_url":"https://api.github.com/users/azine/following{/other_user}","gists_url":"https://api.github.com/users/azine/gists{/gist_id}","starred_url":"https://api.github.com/users/azine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azine/subscriptions","organizations_url":"https://api.github.com/users/azine/orgs","repos_url":"https://api.github.com/users/azine/repos","events_url":"https://api.github.com/users/azine/events{/privacy}","received_events_url":"https://api.github.com/users/azine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azine/AzineMailgunWebhooksBundle","description":"Symfony2 Bundle to easily capture feedback from mailgun.com via their provided webhooks","fork":false,"url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle","forks_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/forks","keys_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/teams","hooks_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/hooks","issue_events_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues/events{/number}","events_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/events","assignees_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/assignees{/user}","branches_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/branches{/branch}","tags_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/tags","blobs_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/languages","stargazers_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/stargazers","contributors_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/contributors","subscribers_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/subscribers","subscription_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/subscription","commits_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/contents/{+path}","compare_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/merges","archive_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/downloads","issues_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues{/number}","pulls_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/labels{/name}","releases_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/releases{/id}","deployments_url":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/deployments","created_at":"2013-12-18T15:05:26Z","updated_at":"2017-02-22T20:15:12Z","pushed_at":"2017-07-28T09:02:32Z","git_url":"git://github.com/azine/AzineMailgunWebhooksBundle.git","ssh_url":"git@github.com:azine/AzineMailgunWebhooksBundle.git","clone_url":"https://github.com/azine/AzineMailgunWebhooksBundle.git","svn_url":"https://github.com/azine/AzineMailgunWebhooksBundle","homepage":null,"size":172,"stargazers_count":8,"watchers_count":8,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7"},"html":{"href":"https://github.com/azine/AzineMailgunWebhooksBundle/pull/7"},"issue":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues/7"},"comments":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/azine/AzineMailgunWebhooksBundle/statuses/ff1b2a65acc450e06e1b9a72c16aa2e029efe209"}}}}
{"actor":{"display_login":"azine"}}