{"action":"created","comment":{"url":"https://api.github.com/repos/indico/indico/pulls/comments/77844334","id":77844334,"diff_hunk":"@@ -136,3 +137,56 @@ def render_list(self):\n             'filtering_enabled': filtering_enabled,\n             'filter_statistics': filter_statistics\n         }\n+\n+\n+def build_default_email_template(event, tpl_type):\n+    tpl = AbstractEmailTemplate()\n+    email = get_template_module('events/abstracts/emails/abstract_{}_notification.txt'.format(tpl_type))\n+    tpl.body = email.get_body()\n+    tpl.extra_cc_emails = []\n+    tpl.reply_to_address = to_unicode(event.as_legacy.getSupportInfo().getEmail()) or ''\n+    tpl.subject = email.get_subject()\n+    tpl.include_authors = True\n+    tpl.include_submitter = True\n+    tpl.include_coauthors = True\n+    return tpl\n+\n+\n+def create_mock_abstract(event):\n+    \"\"\"Create a mock abstract that can be used in previews.\n+\n+       Brace for geek references.\n+    \"\"\"\n+    User = namedtuple('Author', ['first_name', 'last_name', 'title', 'full_name'])\n+    Track = namedtuple('Track', ['title'])\n+    Session = namedtuple('Session', ['title'])\n+    ContributionType = namedtuple('ContributionType', ['name'])\n+    Contribution = namedtuple('Contribution', ['title', 'track', 'session', 'type', 'locator'])\n+    Abstract = namedtuple('Abstract', ['friendly_id', 'title', 'event_new', 'submitter', 'contribution',\n+                                       'primary_authors', 'secondary_authors', 'locator'])\n+\n+    englert = User(full_name=\"Fran\\xe7ois Englert\", first_name=\"Fran\\xe7ois\", last_name=\"Englert\", title=\"Prof.\")\n+    brout = User(full_name=\"Robert Brout\", first_name=\"Robert\", last_name=\"Brout\", title=\"Prof.\")\n+    guralnik = User(full_name=\"Gerald Guralnik\", first_name=\"Gerald\", last_name=\"Guralnik\", title=\"Prof.\")\n+    hagen = User(full_name=\"Carl Hagen\", first_name=\"Carl\", last_name=\"Hagen\", title=\"Prof.\")\n+    kibble = User(full_name=\"Tom Kibble\", first_name=\"Tom\", last_name=\"Kibble\", title=\"Prof.\")\n+    higgs = User(full_name=\"Peter Higgs\", first_name=\"Peter\", last_name=\"Higgs\", title=\"Prof.\")\n+\n+    track = Track(title=_(\"Higgs Fields\"))\n+    session = Session(title=_(\"Higgs Fields Posters\"))\n+    contribution_type = ContributionType(name=_(\"Poster\"))\n+    contribution = Contribution(title=\"Broken Symmetry and the Mass of Gauge Vector Mesons\",\n+                                track=track,\n+                                session=session,\n+                                type=contribution_type,\n+                                locator={'confId': -314, 'contrib_id': 1234})\n+    abstract = Abstract(friendly_id=314,\n+                        title=\"Broken Symmetry and the Mass of Gauge Vector Mesons\",\n+                        event_new=event,\n+                        submitter=brout,\n+                        contribution=contribution,\n+                        primary_authors=[englert, brout],\n+                        secondary_authors=[guralnik, hagen, kibble, higgs],\n+                        locator={'confId': -314, 'abstractId': 1234})","path":"indico/modules/events/abstracts/util.py","position":67,"original_position":67,"commit_id":"a503f55dc6f738b72d5a14a8bee21c03f762ba26","original_commit_id":"a503f55dc6f738b72d5a14a8bee21c03f762ba26","user":{"login":"ThiefMaster","id":179599,"avatar_url":"https://avatars.githubusercontent.com/u/179599?v=3","gravatar_id":"","url":"https://api.github.com/users/ThiefMaster","html_url":"https://github.com/ThiefMaster","followers_url":"https://api.github.com/users/ThiefMaster/followers","following_url":"https://api.github.com/users/ThiefMaster/following{/other_user}","gists_url":"https://api.github.com/users/ThiefMaster/gists{/gist_id}","starred_url":"https://api.github.com/users/ThiefMaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThiefMaster/subscriptions","organizations_url":"https://api.github.com/users/ThiefMaster/orgs","repos_url":"https://api.github.com/users/ThiefMaster/repos","events_url":"https://api.github.com/users/ThiefMaster/events{/privacy}","received_events_url":"https://api.github.com/users/ThiefMaster/received_events","type":"User","site_admin":false},"body":"`abstract_id`","created_at":"2016-09-07T15:21:48Z","updated_at":"2016-09-07T15:21:48Z","html_url":"https://github.com/indico/indico/pull/2595#discussion_r77844334","pull_request_url":"https://api.github.com/repos/indico/indico/pulls/2595","_links":{"self":{"href":"https://api.github.com/repos/indico/indico/pulls/comments/77844334"},"html":{"href":"https://github.com/indico/indico/pull/2595#discussion_r77844334"},"pull_request":{"href":"https://api.github.com/repos/indico/indico/pulls/2595"}}},"pull_request":{"url":"https://api.github.com/repos/indico/indico/pulls/2595","id":84298449,"html_url":"https://github.com/indico/indico/pull/2595","diff_url":"https://github.com/indico/indico/pull/2595.diff","patch_url":"https://github.com/indico/indico/pull/2595.patch","issue_url":"https://api.github.com/repos/indico/indico/issues/2595","number":2595,"state":"open","locked":false,"title":"WIP: Notification e-mails","user":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"body":"Things missing:\r\n * [ ] Unit tests\r\n * [ ] Actually sending e-mails from within the `send_abstract_notifications` function\r\n * [ ] Actually invoking `send_abstract_notifications` when required\r\n * [ ] Handling different \"types\" of Contribution Type and Track - e.g. when `state == merged` we shouldn't take into account `accepted_contrib_type_id`, since it hasn't been accepted.\r\n * [ ] Printing a warning somewhere in case there is a misspelled placeholder","created_at":"2016-09-07T13:19:19Z","updated_at":"2016-09-07T15:21:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3478c1c882d19bb7ef49e031a75b2579317705e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/indico/indico/pulls/2595/commits","review_comments_url":"https://api.github.com/repos/indico/indico/pulls/2595/comments","review_comment_url":"https://api.github.com/repos/indico/indico/pulls/comments{/number}","comments_url":"https://api.github.com/repos/indico/indico/issues/2595/comments","statuses_url":"https://api.github.com/repos/indico/indico/statuses/a503f55dc6f738b72d5a14a8bee21c03f762ba26","head":{"label":"pferreir:wip/notification-emails","ref":"wip/notification-emails","sha":"a503f55dc6f738b72d5a14a8bee21c03f762ba26","user":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"repo":{"id":3867135,"name":"indico","full_name":"pferreir/indico","owner":{"login":"pferreir","id":2699,"avatar_url":"https://avatars.githubusercontent.com/u/2699?v=3","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pferreir/indico","description":"The Indico Project (mirror)","fork":true,"url":"https://api.github.com/repos/pferreir/indico","forks_url":"https://api.github.com/repos/pferreir/indico/forks","keys_url":"https://api.github.com/repos/pferreir/indico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pferreir/indico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pferreir/indico/teams","hooks_url":"https://api.github.com/repos/pferreir/indico/hooks","issue_events_url":"https://api.github.com/repos/pferreir/indico/issues/events{/number}","events_url":"https://api.github.com/repos/pferreir/indico/events","assignees_url":"https://api.github.com/repos/pferreir/indico/assignees{/user}","branches_url":"https://api.github.com/repos/pferreir/indico/branches{/branch}","tags_url":"https://api.github.com/repos/pferreir/indico/tags","blobs_url":"https://api.github.com/repos/pferreir/indico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pferreir/indico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pferreir/indico/git/refs{/sha}","trees_url":"https://api.github.com/repos/pferreir/indico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pferreir/indico/statuses/{sha}","languages_url":"https://api.github.com/repos/pferreir/indico/languages","stargazers_url":"https://api.github.com/repos/pferreir/indico/stargazers","contributors_url":"https://api.github.com/repos/pferreir/indico/contributors","subscribers_url":"https://api.github.com/repos/pferreir/indico/subscribers","subscription_url":"https://api.github.com/repos/pferreir/indico/subscription","commits_url":"https://api.github.com/repos/pferreir/indico/commits{/sha}","git_commits_url":"https://api.github.com/repos/pferreir/indico/git/commits{/sha}","comments_url":"https://api.github.com/repos/pferreir/indico/comments{/number}","issue_comment_url":"https://api.github.com/repos/pferreir/indico/issues/comments{/number}","contents_url":"https://api.github.com/repos/pferreir/indico/contents/{+path}","compare_url":"https://api.github.com/repos/pferreir/indico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pferreir/indico/merges","archive_url":"https://api.github.com/repos/pferreir/indico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pferreir/indico/downloads","issues_url":"https://api.github.com/repos/pferreir/indico/issues{/number}","pulls_url":"https://api.github.com/repos/pferreir/indico/pulls{/number}","milestones_url":"https://api.github.com/repos/pferreir/indico/milestones{/number}","notifications_url":"https://api.github.com/repos/pferreir/indico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pferreir/indico/labels{/name}","releases_url":"https://api.github.com/repos/pferreir/indico/releases{/id}","deployments_url":"https://api.github.com/repos/pferreir/indico/deployments","created_at":"2012-03-29T15:01:36Z","updated_at":"2015-05-04T14:44:08Z","pushed_at":"2016-09-07T13:29:15Z","git_url":"git://github.com/pferreir/indico.git","ssh_url":"git@github.com:pferreir/indico.git","clone_url":"https://github.com/pferreir/indico.git","svn_url":"https://github.com/pferreir/indico","homepage":"http://indico-software.org","size":192262,"stargazers_count":1,"watchers_count":1,"language":"Python","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":1,"default_branch":"master"}},"base":{"label":"indico:devel","ref":"devel","sha":"5ad9084e302172722ff79529e0bdddbfc9113214","user":{"login":"indico","id":715236,"avatar_url":"https://avatars.githubusercontent.com/u/715236?v=3","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"repo":{"id":2113067,"name":"indico","full_name":"indico/indico","owner":{"login":"indico","id":715236,"avatar_url":"https://avatars.githubusercontent.com/u/715236?v=3","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/indico/indico","description":"The Indico Project","fork":false,"url":"https://api.github.com/repos/indico/indico","forks_url":"https://api.github.com/repos/indico/indico/forks","keys_url":"https://api.github.com/repos/indico/indico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indico/indico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indico/indico/teams","hooks_url":"https://api.github.com/repos/indico/indico/hooks","issue_events_url":"https://api.github.com/repos/indico/indico/issues/events{/number}","events_url":"https://api.github.com/repos/indico/indico/events","assignees_url":"https://api.github.com/repos/indico/indico/assignees{/user}","branches_url":"https://api.github.com/repos/indico/indico/branches{/branch}","tags_url":"https://api.github.com/repos/indico/indico/tags","blobs_url":"https://api.github.com/repos/indico/indico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indico/indico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indico/indico/git/refs{/sha}","trees_url":"https://api.github.com/repos/indico/indico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indico/indico/statuses/{sha}","languages_url":"https://api.github.com/repos/indico/indico/languages","stargazers_url":"https://api.github.com/repos/indico/indico/stargazers","contributors_url":"https://api.github.com/repos/indico/indico/contributors","subscribers_url":"https://api.github.com/repos/indico/indico/subscribers","subscription_url":"https://api.github.com/repos/indico/indico/subscription","commits_url":"https://api.github.com/repos/indico/indico/commits{/sha}","git_commits_url":"https://api.github.com/repos/indico/indico/git/commits{/sha}","comments_url":"https://api.github.com/repos/indico/indico/comments{/number}","issue_comment_url":"https://api.github.com/repos/indico/indico/issues/comments{/number}","contents_url":"https://api.github.com/repos/indico/indico/contents/{+path}","compare_url":"https://api.github.com/repos/indico/indico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indico/indico/merges","archive_url":"https://api.github.com/repos/indico/indico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indico/indico/downloads","issues_url":"https://api.github.com/repos/indico/indico/issues{/number}","pulls_url":"https://api.github.com/repos/indico/indico/pulls{/number}","milestones_url":"https://api.github.com/repos/indico/indico/milestones{/number}","notifications_url":"https://api.github.com/repos/indico/indico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indico/indico/labels{/name}","releases_url":"https://api.github.com/repos/indico/indico/releases{/id}","deployments_url":"https://api.github.com/repos/indico/indico/deployments","created_at":"2011-07-27T13:56:30Z","updated_at":"2016-09-06T21:05:53Z","pushed_at":"2016-09-07T15:04:56Z","git_url":"git://github.com/indico/indico.git","ssh_url":"git@github.com:indico/indico.git","clone_url":"https://github.com/indico/indico.git","svn_url":"https://github.com/indico/indico","homepage":"http://indico-software.org","size":202600,"stargazers_count":163,"watchers_count":163,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":615,"forks":81,"open_issues":615,"watchers":163,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/indico/indico/pulls/2595"},"html":{"href":"https://github.com/indico/indico/pull/2595"},"issue":{"href":"https://api.github.com/repos/indico/indico/issues/2595"},"comments":{"href":"https://api.github.com/repos/indico/indico/issues/2595/comments"},"review_comments":{"href":"https://api.github.com/repos/indico/indico/pulls/2595/comments"},"review_comment":{"href":"https://api.github.com/repos/indico/indico/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/indico/indico/pulls/2595/commits"},"statuses":{"href":"https://api.github.com/repos/indico/indico/statuses/a503f55dc6f738b72d5a14a8bee21c03f762ba26"}}}}
{"actor":{"display_login":"ThiefMaster"}}