{"action":"created","issue":{"url":"https://api.github.com/repos/publiclab/plots2/issues/3606","repository_url":"https://api.github.com/repos/publiclab/plots2","labels_url":"https://api.github.com/repos/publiclab/plots2/issues/3606/labels{/name}","comments_url":"https://api.github.com/repos/publiclab/plots2/issues/3606/comments","events_url":"https://api.github.com/repos/publiclab/plots2/issues/3606/events","html_url":"https://github.com/publiclab/plots2/issues/3606","id":366876203,"node_id":"MDU6SXNzdWUzNjY4NzYyMDM=","number":3606,"title":"[Multiple-use] Add explanation to all node-based email notifications to reply-by-email","user":{"login":"jywarren","id":24359,"node_id":"MDQ6VXNlcjI0MzU5","avatar_url":"https://avatars1.githubusercontent.com/u/24359?v=4","gravatar_id":"","url":"https://api.github.com/users/jywarren","html_url":"https://github.com/jywarren","followers_url":"https://api.github.com/users/jywarren/followers","following_url":"https://api.github.com/users/jywarren/following{/other_user}","gists_url":"https://api.github.com/users/jywarren/gists{/gist_id}","starred_url":"https://api.github.com/users/jywarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jywarren/subscriptions","organizations_url":"https://api.github.com/users/jywarren/orgs","repos_url":"https://api.github.com/users/jywarren/repos","events_url":"https://api.github.com/users/jywarren/events{/privacy}","received_events_url":"https://api.github.com/users/jywarren/received_events","type":"User","site_admin":false},"labels":[{"id":343384842,"node_id":"MDU6TGFiZWwzNDMzODQ4NDI=","url":"https://api.github.com/repos/publiclab/plots2/labels/Ruby","name":"Ruby","color":"006b75","default":false},{"id":471889929,"node_id":"MDU6TGFiZWw0NzE4ODk5Mjk=","url":"https://api.github.com/repos/publiclab/plots2/labels/fto-candidate","name":"fto-candidate","color":"bfd4f2","default":false},{"id":173349489,"node_id":"MDU6TGFiZWwxNzMzNDk0ODk=","url":"https://api.github.com/repos/publiclab/plots2/labels/help-wanted","name":"help-wanted","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/publiclab/plots2/milestones/9","html_url":"https://github.com/publiclab/plots2/milestone/9","labels_url":"https://api.github.com/repos/publiclab/plots2/milestones/9/labels","id":2515646,"node_id":"MDk6TWlsZXN0b25lMjUxNTY0Ng==","number":9,"title":"Email notifications overhaul","description":"Planning issue: #2104","creator":{"login":"jywarren","id":24359,"node_id":"MDQ6VXNlcjI0MzU5","avatar_url":"https://avatars1.githubusercontent.com/u/24359?v=4","gravatar_id":"","url":"https://api.github.com/users/jywarren","html_url":"https://github.com/jywarren","followers_url":"https://api.github.com/users/jywarren/followers","following_url":"https://api.github.com/users/jywarren/following{/other_user}","gists_url":"https://api.github.com/users/jywarren/gists{/gist_id}","starred_url":"https://api.github.com/users/jywarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jywarren/subscriptions","organizations_url":"https://api.github.com/users/jywarren/orgs","repos_url":"https://api.github.com/users/jywarren/repos","events_url":"https://api.github.com/users/jywarren/events{/privacy}","received_events_url":"https://api.github.com/users/jywarren/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":28,"state":"open","created_at":"2017-05-11T16:30:30Z","updated_at":"2018-10-04T16:40:00Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-10-04T16:39:59Z","updated_at":"2018-10-04T18:30:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"We have a new reply-by-email system! It's great, and means you can reply to many emails you get from PublicLab.org and expect your email to be added as a comment. 💬 💥 ✉️ \r\n\r\nHowever, not all our email notifications make this clear yet -- since this is new, most warn people NOT to reply by email. Let's change that! 🎉 \r\n\r\nChanging it will take 3 steps per email template:\r\n\r\n## 1. Change email subject lines to include node ids in format `(#0000)`\r\n\r\nThe new feature works by looking for a node ID in the subject line, looking up that node and attaching response emails to that node as comments. So we need each email notification to have a specially formatted node id in the subject line. Here's how they should change:\r\n\r\n```diff\r\n    mail(to: user.email, subject: 'You were mentioned in a comment.')\r\n    mail(to: user.email, subject: \"You were mentioned in a comment. (##{comment.node.id}) \")\r\n```\r\n\r\nThe variable may be `node.id` instead of `comment.node.id` -- it depends on the context. You can find all the mailer functions in this folder, so look through to see which one you want to take on:\r\n\r\nhttps://github.com/publiclab/plots2/tree/master/app/mailers\r\n\r\n\r\n\r\n## 2. Change instructions in email body\r\n\r\nMany email addresses warn you not to reply by email with the phrase `Do NOT reply to this email`. You can find them in this search (until we get them all!):\r\n\r\nhttps://github.com/publiclab/plots2/search?q=%22Do+NOT+reply+to+this+email%22&unscoped_q=%22Do+NOT+reply+to+this+email%22\r\n\r\nOnce the email subject line is changed for a given template (and not before!) we can change this instruction from the top line to the bottom line:\r\n\r\n```diff\r\n- Hi! There's been a response to a discussion you're involved in. Do NOT reply to this email; click this link to respond:\r\n+ Hi! There's been a response to a discussion you're involved in. You can reply to this email or visit this link:\r\n```\r\n\r\nSee how someone did this for an existing template here: https://github.com/publiclab/plots2/commit/990c965aea47da7613c2825949a42f1ca7c29ec1\r\n\r\n## 3. Update test\r\n\r\nWe'll help you with this step. Basically we have tests to confirm the subject line of each message sent. We'll need to update the tests to reflect the new subject lines, like this!\r\n\r\n```diff\r\n-    assert_equal \"[PublicLab] #{user.username} liked your research note\", email.subject\r\n+   assert_equal \"[PublicLab] #{user.username} liked your research note (##{node.id})\", email.subject\r\n```\r\n\r\nThat's it! Please take on only one email notification at a time in a pull request, and we can help and double-check your work. \r\n\r\nAlso, some email notifications are not linked to just a single node -- so those won't be helpful to convert. If in doubt, link to the one you want to try (in the comments below) and we'll explain! 👍 "},"comment":{"url":"https://api.github.com/repos/publiclab/plots2/issues/comments/427123235","html_url":"https://github.com/publiclab/plots2/issues/3606#issuecomment-427123235","issue_url":"https://api.github.com/repos/publiclab/plots2/issues/3606","id":427123235,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzEyMzIzNQ==","user":{"login":"rohan2599","id":31514059,"node_id":"MDQ6VXNlcjMxNTE0MDU5","avatar_url":"https://avatars3.githubusercontent.com/u/31514059?v=4","gravatar_id":"","url":"https://api.github.com/users/rohan2599","html_url":"https://github.com/rohan2599","followers_url":"https://api.github.com/users/rohan2599/followers","following_url":"https://api.github.com/users/rohan2599/following{/other_user}","gists_url":"https://api.github.com/users/rohan2599/gists{/gist_id}","starred_url":"https://api.github.com/users/rohan2599/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohan2599/subscriptions","organizations_url":"https://api.github.com/users/rohan2599/orgs","repos_url":"https://api.github.com/users/rohan2599/repos","events_url":"https://api.github.com/users/rohan2599/events{/privacy}","received_events_url":"https://api.github.com/users/rohan2599/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T18:30:07Z","updated_at":"2018-10-04T18:30:07Z","author_association":"NONE","body":"@jywarren I have completed step1 and step 2 ,Actually I was talking about step 3 i.e which files are needed to be changed in step 3 ,because the test/unit/subscription_mailer_test.rb is fully changed ,so do I need to change all the mailer test files ?\r\n.Thank you."}}
{"actor":{"display_login":"rohan2599"}}