{"action":"closed","number":88,"pull_request":{"url":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/88","id":58959152,"html_url":"https://github.com/ritstudentgovernment/petitions/pull/88","diff_url":"https://github.com/ritstudentgovernment/petitions/pull/88.diff","patch_url":"https://github.com/ritstudentgovernment/petitions/pull/88.patch","issue_url":"https://api.github.com/repos/ritstudentgovernment/petitions/issues/88","number":88,"state":"closed","locked":false,"title":"Genericize emails","user":{"login":"ceko","id":2207795,"avatar_url":"https://avatars.githubusercontent.com/u/2207795?v=3","gravatar_id":"","url":"https://api.github.com/users/ceko","html_url":"https://github.com/ceko","followers_url":"https://api.github.com/users/ceko/followers","following_url":"https://api.github.com/users/ceko/following{/other_user}","gists_url":"https://api.github.com/users/ceko/gists{/gist_id}","starred_url":"https://api.github.com/users/ceko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceko/subscriptions","organizations_url":"https://api.github.com/users/ceko/orgs","repos_url":"https://api.github.com/users/ceko/repos","events_url":"https://api.github.com/users/ceko/events{/privacy}","received_events_url":"https://api.github.com/users/ceko/received_events","type":"User","site_admin":false},"body":"This is a large change, I'd like your input.  All emails have been tested but I'm not familiar enough with the app to be totally comfortable yet.  I made several changes to the settings file, here is how mine looks:\r\n\r\n```\r\n{\r\n  ...\r\n  \"MAIL\": {\r\n    \"default_domain\": \"naz.edu\",\r\n    \"gateway_url\": \"smtp://web_smtp_relay:password_redacted@smtp.naz.edu:25\",\r\n    \"templates\": {\r\n      \"default\": {\r\n        \"from\": \"web_tech@naz.edu\",\r\n        \"to\": \"web_tech@naz.edu\"\r\n      },\r\n      \"report_petition\": {\r\n        \"subject\": \"[petitions] Petition Reported\",\r\n        \"template\": \"report_petition\"\r\n      },\r\n      \"petition_approved\": {\r\n        \"subject\": \"PawPrints - A petition you created has been approved\",\r\n        \"template\": \"petition_approved\"\r\n      },\r\n      \"petition_rejected\": {\r\n        \"subject\": \"PawPrints - A petition you created has been rejected\",\r\n        \"template\": \"petition_rejected\"\r\n      },\r\n      \"petition_threshold_reached\": {\r\n        \"subject\": \"PawPrints - Petition Reaches Signature Threshold\",\r\n        \"template\": \"petition_threshold_reached\"        \r\n      },\r\n      \"petition_response_received\": {\r\n        \"subject\": \"PawPrints - A petition you signed has received a response\",\r\n        \"template\": \"petition_response_received\"\r\n      },\r\n      \"petition_status_update\": {\r\n        \"subject\": \"PawPrints - A petition you signed has a status update\",\r\n        \"template\": \"petition_status_update\"\r\n      }\r\n    }\r\n  },\r\n  ...\r\n}\r\n```\r\n\r\nThe MAIL section is new.  I pushed the old MAIL_URL to MAIL.gateway_url.  Also sending emails made a couple assumptions that I couldn't meet.  I pulled out references to @rit.edu and made it reference the MAIL.default_domain variable instead.  Also, we don't follow username@naz.edu religiously, so in one of my previous pull requests, I store your email address in your profile, and I default to using that if it's not blank.\r\n\r\nMAIL.templates is a map of keys with the values you'd expect to find in the Email.send function.  The new Mailer object uses this map to determine what the dictionary passed to Email.send should be.  That class is pretty well commented, so I'd look there first.\r\n\r\nThe template variable is used to process a template loaded by the https://github.com/meteorhacks/meteor-ssr package.  I use this to override email text in my external package, and because it's just nicer working with templates when you're sending email.\r\n\r\nThis change accomplishes a couple things.  Firstly, I can now override all aspects of an email, I can have individualized from, to, subject, and text from an external package.  Another thing which isn't included in this push, is that I can override any setting from the Mailer object.  For example, I can change the to address to always be web_tech@naz.edu on development, so I don't accidentally send emails to the wrong person.  This would be accomplished by having an overrides section that is similar to the default section, but would override any settings, even ones passed in by the user.\r\n\r\nPlease give me your thoughts on this, I will push out a change or two tomorrow.\r\n\r\n","created_at":"2016-02-10T21:48:45Z","updated_at":"2016-03-03T04:46:50Z","closed_at":"2016-03-03T04:46:50Z","merged_at":"2016-03-03T04:46:50Z","merge_commit_sha":"fe1cdf0c5a5a785cb3afccafecf2f19fc04d8646","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/88/commits","review_comments_url":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/88/comments","review_comment_url":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ritstudentgovernment/petitions/issues/88/comments","statuses_url":"https://api.github.com/repos/ritstudentgovernment/petitions/statuses/95ea83f159540a35d83d0919b1cd7f066381857c","head":{"label":"ceko:genericize-emails","ref":"genericize-emails","sha":"95ea83f159540a35d83d0919b1cd7f066381857c","user":{"login":"ceko","id":2207795,"avatar_url":"https://avatars.githubusercontent.com/u/2207795?v=3","gravatar_id":"","url":"https://api.github.com/users/ceko","html_url":"https://github.com/ceko","followers_url":"https://api.github.com/users/ceko/followers","following_url":"https://api.github.com/users/ceko/following{/other_user}","gists_url":"https://api.github.com/users/ceko/gists{/gist_id}","starred_url":"https://api.github.com/users/ceko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceko/subscriptions","organizations_url":"https://api.github.com/users/ceko/orgs","repos_url":"https://api.github.com/users/ceko/repos","events_url":"https://api.github.com/users/ceko/events{/privacy}","received_events_url":"https://api.github.com/users/ceko/received_events","type":"User","site_admin":false},"repo":{"id":51451828,"name":"petitions","full_name":"ceko/petitions","owner":{"login":"ceko","id":2207795,"avatar_url":"https://avatars.githubusercontent.com/u/2207795?v=3","gravatar_id":"","url":"https://api.github.com/users/ceko","html_url":"https://github.com/ceko","followers_url":"https://api.github.com/users/ceko/followers","following_url":"https://api.github.com/users/ceko/following{/other_user}","gists_url":"https://api.github.com/users/ceko/gists{/gist_id}","starred_url":"https://api.github.com/users/ceko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceko/subscriptions","organizations_url":"https://api.github.com/users/ceko/orgs","repos_url":"https://api.github.com/users/ceko/repos","events_url":"https://api.github.com/users/ceko/events{/privacy}","received_events_url":"https://api.github.com/users/ceko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ceko/petitions","description":"PawPrints petition application for the RIT community.","fork":true,"url":"https://api.github.com/repos/ceko/petitions","forks_url":"https://api.github.com/repos/ceko/petitions/forks","keys_url":"https://api.github.com/repos/ceko/petitions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceko/petitions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceko/petitions/teams","hooks_url":"https://api.github.com/repos/ceko/petitions/hooks","issue_events_url":"https://api.github.com/repos/ceko/petitions/issues/events{/number}","events_url":"https://api.github.com/repos/ceko/petitions/events","assignees_url":"https://api.github.com/repos/ceko/petitions/assignees{/user}","branches_url":"https://api.github.com/repos/ceko/petitions/branches{/branch}","tags_url":"https://api.github.com/repos/ceko/petitions/tags","blobs_url":"https://api.github.com/repos/ceko/petitions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceko/petitions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceko/petitions/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceko/petitions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceko/petitions/statuses/{sha}","languages_url":"https://api.github.com/repos/ceko/petitions/languages","stargazers_url":"https://api.github.com/repos/ceko/petitions/stargazers","contributors_url":"https://api.github.com/repos/ceko/petitions/contributors","subscribers_url":"https://api.github.com/repos/ceko/petitions/subscribers","subscription_url":"https://api.github.com/repos/ceko/petitions/subscription","commits_url":"https://api.github.com/repos/ceko/petitions/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceko/petitions/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceko/petitions/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceko/petitions/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceko/petitions/contents/{+path}","compare_url":"https://api.github.com/repos/ceko/petitions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceko/petitions/merges","archive_url":"https://api.github.com/repos/ceko/petitions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceko/petitions/downloads","issues_url":"https://api.github.com/repos/ceko/petitions/issues{/number}","pulls_url":"https://api.github.com/repos/ceko/petitions/pulls{/number}","milestones_url":"https://api.github.com/repos/ceko/petitions/milestones{/number}","notifications_url":"https://api.github.com/repos/ceko/petitions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceko/petitions/labels{/name}","releases_url":"https://api.github.com/repos/ceko/petitions/releases{/id}","deployments_url":"https://api.github.com/repos/ceko/petitions/deployments","created_at":"2016-02-10T15:57:21Z","updated_at":"2016-02-10T15:57:22Z","pushed_at":"2016-02-15T15:12:44Z","git_url":"git://github.com/ceko/petitions.git","ssh_url":"git@github.com:ceko/petitions.git","clone_url":"https://github.com/ceko/petitions.git","svn_url":"https://github.com/ceko/petitions","homepage":"https://pawprints.rit.edu","size":27020,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"nazfork-develop"}},"base":{"label":"ritstudentgovernment:develop","ref":"develop","sha":"e379815ec8d7431443e95dd09e7f4db7932e38a2","user":{"login":"ritstudentgovernment","id":8528029,"avatar_url":"https://avatars.githubusercontent.com/u/8528029?v=3","gravatar_id":"","url":"https://api.github.com/users/ritstudentgovernment","html_url":"https://github.com/ritstudentgovernment","followers_url":"https://api.github.com/users/ritstudentgovernment/followers","following_url":"https://api.github.com/users/ritstudentgovernment/following{/other_user}","gists_url":"https://api.github.com/users/ritstudentgovernment/gists{/gist_id}","starred_url":"https://api.github.com/users/ritstudentgovernment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritstudentgovernment/subscriptions","organizations_url":"https://api.github.com/users/ritstudentgovernment/orgs","repos_url":"https://api.github.com/users/ritstudentgovernment/repos","events_url":"https://api.github.com/users/ritstudentgovernment/events{/privacy}","received_events_url":"https://api.github.com/users/ritstudentgovernment/received_events","type":"Organization","site_admin":false},"repo":{"id":23244695,"name":"petitions","full_name":"ritstudentgovernment/petitions","owner":{"login":"ritstudentgovernment","id":8528029,"avatar_url":"https://avatars.githubusercontent.com/u/8528029?v=3","gravatar_id":"","url":"https://api.github.com/users/ritstudentgovernment","html_url":"https://github.com/ritstudentgovernment","followers_url":"https://api.github.com/users/ritstudentgovernment/followers","following_url":"https://api.github.com/users/ritstudentgovernment/following{/other_user}","gists_url":"https://api.github.com/users/ritstudentgovernment/gists{/gist_id}","starred_url":"https://api.github.com/users/ritstudentgovernment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritstudentgovernment/subscriptions","organizations_url":"https://api.github.com/users/ritstudentgovernment/orgs","repos_url":"https://api.github.com/users/ritstudentgovernment/repos","events_url":"https://api.github.com/users/ritstudentgovernment/events{/privacy}","received_events_url":"https://api.github.com/users/ritstudentgovernment/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ritstudentgovernment/petitions","description":"PawPrints petition application for the RIT community.","fork":true,"url":"https://api.github.com/repos/ritstudentgovernment/petitions","forks_url":"https://api.github.com/repos/ritstudentgovernment/petitions/forks","keys_url":"https://api.github.com/repos/ritstudentgovernment/petitions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ritstudentgovernment/petitions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ritstudentgovernment/petitions/teams","hooks_url":"https://api.github.com/repos/ritstudentgovernment/petitions/hooks","issue_events_url":"https://api.github.com/repos/ritstudentgovernment/petitions/issues/events{/number}","events_url":"https://api.github.com/repos/ritstudentgovernment/petitions/events","assignees_url":"https://api.github.com/repos/ritstudentgovernment/petitions/assignees{/user}","branches_url":"https://api.github.com/repos/ritstudentgovernment/petitions/branches{/branch}","tags_url":"https://api.github.com/repos/ritstudentgovernment/petitions/tags","blobs_url":"https://api.github.com/repos/ritstudentgovernment/petitions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ritstudentgovernment/petitions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ritstudentgovernment/petitions/git/refs{/sha}","trees_url":"https://api.github.com/repos/ritstudentgovernment/petitions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ritstudentgovernment/petitions/statuses/{sha}","languages_url":"https://api.github.com/repos/ritstudentgovernment/petitions/languages","stargazers_url":"https://api.github.com/repos/ritstudentgovernment/petitions/stargazers","contributors_url":"https://api.github.com/repos/ritstudentgovernment/petitions/contributors","subscribers_url":"https://api.github.com/repos/ritstudentgovernment/petitions/subscribers","subscription_url":"https://api.github.com/repos/ritstudentgovernment/petitions/subscription","commits_url":"https://api.github.com/repos/ritstudentgovernment/petitions/commits{/sha}","git_commits_url":"https://api.github.com/repos/ritstudentgovernment/petitions/git/commits{/sha}","comments_url":"https://api.github.com/repos/ritstudentgovernment/petitions/comments{/number}","issue_comment_url":"https://api.github.com/repos/ritstudentgovernment/petitions/issues/comments{/number}","contents_url":"https://api.github.com/repos/ritstudentgovernment/petitions/contents/{+path}","compare_url":"https://api.github.com/repos/ritstudentgovernment/petitions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ritstudentgovernment/petitions/merges","archive_url":"https://api.github.com/repos/ritstudentgovernment/petitions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ritstudentgovernment/petitions/downloads","issues_url":"https://api.github.com/repos/ritstudentgovernment/petitions/issues{/number}","pulls_url":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls{/number}","milestones_url":"https://api.github.com/repos/ritstudentgovernment/petitions/milestones{/number}","notifications_url":"https://api.github.com/repos/ritstudentgovernment/petitions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ritstudentgovernment/petitions/labels{/name}","releases_url":"https://api.github.com/repos/ritstudentgovernment/petitions/releases{/id}","deployments_url":"https://api.github.com/repos/ritstudentgovernment/petitions/deployments","created_at":"2014-08-23T01:16:44Z","updated_at":"2016-03-03T03:20:21Z","pushed_at":"2016-03-03T04:46:50Z","git_url":"git://github.com/ritstudentgovernment/petitions.git","ssh_url":"git@github.com:ritstudentgovernment/petitions.git","clone_url":"https://github.com/ritstudentgovernment/petitions.git","svn_url":"https://github.com/ritstudentgovernment/petitions","homepage":"https://pawprints.rit.edu","size":31709,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":15,"forks":13,"open_issues":15,"watchers":32,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/88"},"html":{"href":"https://github.com/ritstudentgovernment/petitions/pull/88"},"issue":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/issues/88"},"comments":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/ritstudentgovernment/petitions/statuses/95ea83f159540a35d83d0919b1cd7f066381857c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"NathanCastle","id":5623999,"avatar_url":"https://avatars.githubusercontent.com/u/5623999?v=3","gravatar_id":"","url":"https://api.github.com/users/NathanCastle","html_url":"https://github.com/NathanCastle","followers_url":"https://api.github.com/users/NathanCastle/followers","following_url":"https://api.github.com/users/NathanCastle/following{/other_user}","gists_url":"https://api.github.com/users/NathanCastle/gists{/gist_id}","starred_url":"https://api.github.com/users/NathanCastle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NathanCastle/subscriptions","organizations_url":"https://api.github.com/users/NathanCastle/orgs","repos_url":"https://api.github.com/users/NathanCastle/repos","events_url":"https://api.github.com/users/NathanCastle/events{/privacy}","received_events_url":"https://api.github.com/users/NathanCastle/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":8,"additions":356,"deletions":166,"changed_files":21}}