{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/37221143","id":37221143,"diff_hunk":"@@ -0,0 +1,108 @@\n+\"\"\"\n+Tasks for making even transactional emails consolidated.\n+\"\"\"\n+from bson.code import Code\n+from modularodm import Q\n+\n+from framework.tasks import app as celery_app\n+from framework.mongo import database as db\n+from framework.auth.core import User\n+\n+from framework.transactions.context import TokuTransaction\n+\n+from website.notifications.utils import NotificationsDict\n+from website.notifications.model import NotificationDigest\n+from website import mails\n+\n+\n+@celery_app.task(name='notify.send_users_email', max_retries=0)\n+def send_users_email(send_type):\n+    \"\"\"\n+    Finds pending Emails and amalgamates them into a single Email\n+    :param user_id: User id to send mails to.","path":"website/notifications/tasks.py","position":22,"original_position":22,"commit_id":"051feb7a474ed8e3d84ed61eeaa2442b8760aa23","original_commit_id":"051feb7a474ed8e3d84ed61eeaa2442b8760aa23","user":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"body":"This docstring needs to be updated.","created_at":"2015-08-17T18:37:54Z","updated_at":"2015-08-17T18:37:54Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3200#discussion_r37221143","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/37221143"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3200#discussion_r37221143"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200","id":38013807,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/3200","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/3200.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/3200.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3200","number":3200,"state":"open","locked":false,"title":"Feature/solid emails","user":{"login":"Ghalko","id":5169088,"avatar_url":"https://avatars.githubusercontent.com/u/5169088?v=3","gravatar_id":"","url":"https://api.github.com/users/Ghalko","html_url":"https://github.com/Ghalko","followers_url":"https://api.github.com/users/Ghalko/followers","following_url":"https://api.github.com/users/Ghalko/following{/other_user}","gists_url":"https://api.github.com/users/Ghalko/gists{/gist_id}","starred_url":"https://api.github.com/users/Ghalko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ghalko/subscriptions","organizations_url":"https://api.github.com/users/Ghalko/orgs","repos_url":"https://api.github.com/users/Ghalko/repos","events_url":"https://api.github.com/users/Ghalko/events{/privacy}","received_events_url":"https://api.github.com/users/Ghalko/received_events","type":"User","site_admin":false},"body":"## Proposal\r\nEmails within a certain period are consolidated/collated into one digest. This will be especially helpful to limit the number of Emails when a user uploads a number at a time. Rather than another user receiving that number of Emails if they are signed up for immediate Emails, a fifteen minute option would digest the Emails over the last fifteen minutes.\r\n\r\n## Considerations\r\nExtends #2567 as otherwise it really isn't useful, and is currently based on it.\r\n\r\nThe idea is to help define what is meant by the different options so as not to confuse the user.","created_at":"2015-06-18T14:40:25Z","updated_at":"2015-08-17T18:37:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8e6cc31197bcb1395f3106c82f7adb66743e08e","assignee":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3200/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/051feb7a474ed8e3d84ed61eeaa2442b8760aa23","head":{"label":"Ghalko:feature/solid_emails","ref":"feature/solid_emails","sha":"051feb7a474ed8e3d84ed61eeaa2442b8760aa23","user":{"login":"Ghalko","id":5169088,"avatar_url":"https://avatars.githubusercontent.com/u/5169088?v=3","gravatar_id":"","url":"https://api.github.com/users/Ghalko","html_url":"https://github.com/Ghalko","followers_url":"https://api.github.com/users/Ghalko/followers","following_url":"https://api.github.com/users/Ghalko/following{/other_user}","gists_url":"https://api.github.com/users/Ghalko/gists{/gist_id}","starred_url":"https://api.github.com/users/Ghalko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ghalko/subscriptions","organizations_url":"https://api.github.com/users/Ghalko/orgs","repos_url":"https://api.github.com/users/Ghalko/repos","events_url":"https://api.github.com/users/Ghalko/events{/privacy}","received_events_url":"https://api.github.com/users/Ghalko/received_events","type":"User","site_admin":false},"repo":{"id":31034068,"name":"osf.io","full_name":"Ghalko/osf.io","owner":{"login":"Ghalko","id":5169088,"avatar_url":"https://avatars.githubusercontent.com/u/5169088?v=3","gravatar_id":"","url":"https://api.github.com/users/Ghalko","html_url":"https://github.com/Ghalko","followers_url":"https://api.github.com/users/Ghalko/followers","following_url":"https://api.github.com/users/Ghalko/following{/other_user}","gists_url":"https://api.github.com/users/Ghalko/gists{/gist_id}","starred_url":"https://api.github.com/users/Ghalko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ghalko/subscriptions","organizations_url":"https://api.github.com/users/Ghalko/orgs","repos_url":"https://api.github.com/users/Ghalko/repos","events_url":"https://api.github.com/users/Ghalko/events{/privacy}","received_events_url":"https://api.github.com/users/Ghalko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ghalko/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/Ghalko/osf.io","forks_url":"https://api.github.com/repos/Ghalko/osf.io/forks","keys_url":"https://api.github.com/repos/Ghalko/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ghalko/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ghalko/osf.io/teams","hooks_url":"https://api.github.com/repos/Ghalko/osf.io/hooks","issue_events_url":"https://api.github.com/repos/Ghalko/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/Ghalko/osf.io/events","assignees_url":"https://api.github.com/repos/Ghalko/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/Ghalko/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/Ghalko/osf.io/tags","blobs_url":"https://api.github.com/repos/Ghalko/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ghalko/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ghalko/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ghalko/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ghalko/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/Ghalko/osf.io/languages","stargazers_url":"https://api.github.com/repos/Ghalko/osf.io/stargazers","contributors_url":"https://api.github.com/repos/Ghalko/osf.io/contributors","subscribers_url":"https://api.github.com/repos/Ghalko/osf.io/subscribers","subscription_url":"https://api.github.com/repos/Ghalko/osf.io/subscription","commits_url":"https://api.github.com/repos/Ghalko/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ghalko/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ghalko/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ghalko/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ghalko/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/Ghalko/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ghalko/osf.io/merges","archive_url":"https://api.github.com/repos/Ghalko/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ghalko/osf.io/downloads","issues_url":"https://api.github.com/repos/Ghalko/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/Ghalko/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/Ghalko/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/Ghalko/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ghalko/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/Ghalko/osf.io/releases{/id}","created_at":"2015-02-19T20:02:48Z","updated_at":"2015-03-30T13:32:39Z","pushed_at":"2015-08-12T18:45:52Z","git_url":"git://github.com/Ghalko/osf.io.git","ssh_url":"git@github.com:Ghalko/osf.io.git","clone_url":"https://github.com/Ghalko/osf.io.git","svn_url":"https://github.com/Ghalko/osf.io","homepage":"http://osf.io","size":98229,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"f9b62738ba1cc7dff65991ce1c38fa8cee354e8a","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","created_at":"2013-05-21T15:53:37Z","updated_at":"2015-08-05T16:17:51Z","pushed_at":"2015-08-17T18:32:37Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":223012,"stargazers_count":125,"watchers_count":125,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":491,"forks":107,"open_issues":491,"watchers":125,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/3200"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3200"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/3200/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/3200/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/051feb7a474ed8e3d84ed61eeaa2442b8760aa23"}}}}