{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/addons-server/issues/7808","repository_url":"https://api.github.com/repos/mozilla/addons-server","labels_url":"https://api.github.com/repos/mozilla/addons-server/issues/7808/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/addons-server/issues/7808/comments","events_url":"https://api.github.com/repos/mozilla/addons-server/issues/7808/events","html_url":"https://github.com/mozilla/addons-server/issues/7808","id":305316520,"number":7808,"title":"Synchronize dev marketing email setting with Basket","user":{"login":"jvillalobos","id":62568,"avatar_url":"https://avatars2.githubusercontent.com/u/62568?v=4","gravatar_id":"","url":"https://api.github.com/users/jvillalobos","html_url":"https://github.com/jvillalobos","followers_url":"https://api.github.com/users/jvillalobos/followers","following_url":"https://api.github.com/users/jvillalobos/following{/other_user}","gists_url":"https://api.github.com/users/jvillalobos/gists{/gist_id}","starred_url":"https://api.github.com/users/jvillalobos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvillalobos/subscriptions","organizations_url":"https://api.github.com/users/jvillalobos/orgs","repos_url":"https://api.github.com/users/jvillalobos/repos","events_url":"https://api.github.com/users/jvillalobos/events{/privacy}","received_events_url":"https://api.github.com/users/jvillalobos/received_events","type":"User","site_admin":false},"labels":[{"id":353728203,"url":"https://api.github.com/repos/mozilla/addons-server/labels/priority:%20p2","name":"priority: p2","color":"d70022","default":false},{"id":877676020,"url":"https://api.github.com/repos/mozilla/addons-server/labels/project:%202018%20Q2","name":"project: 2018 Q2","color":"b1c8f0","default":false},{"id":259014663,"url":"https://api.github.com/repos/mozilla/addons-server/labels/state:%20in%20progress","name":"state: in progress","color":"FAC60C","default":false},{"id":540035677,"url":"https://api.github.com/repos/mozilla/addons-server/labels/triaged","name":"triaged","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"EnTeQuAk","id":139033,"avatar_url":"https://avatars1.githubusercontent.com/u/139033?v=4","gravatar_id":"","url":"https://api.github.com/users/EnTeQuAk","html_url":"https://github.com/EnTeQuAk","followers_url":"https://api.github.com/users/EnTeQuAk/followers","following_url":"https://api.github.com/users/EnTeQuAk/following{/other_user}","gists_url":"https://api.github.com/users/EnTeQuAk/gists{/gist_id}","starred_url":"https://api.github.com/users/EnTeQuAk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnTeQuAk/subscriptions","organizations_url":"https://api.github.com/users/EnTeQuAk/orgs","repos_url":"https://api.github.com/users/EnTeQuAk/repos","events_url":"https://api.github.com/users/EnTeQuAk/events{/privacy}","received_events_url":"https://api.github.com/users/EnTeQuAk/received_events","type":"User","site_admin":false},"assignees":[{"login":"EnTeQuAk","id":139033,"avatar_url":"https://avatars1.githubusercontent.com/u/139033?v=4","gravatar_id":"","url":"https://api.github.com/users/EnTeQuAk","html_url":"https://github.com/EnTeQuAk","followers_url":"https://api.github.com/users/EnTeQuAk/followers","following_url":"https://api.github.com/users/EnTeQuAk/following{/other_user}","gists_url":"https://api.github.com/users/EnTeQuAk/gists{/gist_id}","starred_url":"https://api.github.com/users/EnTeQuAk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnTeQuAk/subscriptions","organizations_url":"https://api.github.com/users/EnTeQuAk/orgs","repos_url":"https://api.github.com/users/EnTeQuAk/repos","events_url":"https://api.github.com/users/EnTeQuAk/events{/privacy}","received_events_url":"https://api.github.com/users/EnTeQuAk/received_events","type":"User","site_admin":false},{"login":"diox","id":187006,"avatar_url":"https://avatars0.githubusercontent.com/u/187006?v=4","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mozilla/addons-server/milestones/110","html_url":"https://github.com/mozilla/addons-server/milestone/110","labels_url":"https://api.github.com/repos/mozilla/addons-server/milestones/110/labels","id":3280579,"number":110,"title":"2018.05.24","description":"","creator":{"login":"wagnerand","id":873258,"avatar_url":"https://avatars2.githubusercontent.com/u/873258?v=4","gravatar_id":"","url":"https://api.github.com/users/wagnerand","html_url":"https://github.com/wagnerand","followers_url":"https://api.github.com/users/wagnerand/followers","following_url":"https://api.github.com/users/wagnerand/following{/other_user}","gists_url":"https://api.github.com/users/wagnerand/gists{/gist_id}","starred_url":"https://api.github.com/users/wagnerand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wagnerand/subscriptions","organizations_url":"https://api.github.com/users/wagnerand/orgs","repos_url":"https://api.github.com/users/wagnerand/repos","events_url":"https://api.github.com/users/wagnerand/events{/privacy}","received_events_url":"https://api.github.com/users/wagnerand/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":12,"state":"open","created_at":"2018-04-19T09:29:09Z","updated_at":"2018-05-23T18:26:47Z","due_on":"2018-05-22T07:00:00Z","closed_at":null},"comments":52,"created_at":"2018-03-14T20:28:08Z","updated_at":"2018-05-24T12:12:12Z","closed_at":"2018-05-23T18:26:47Z","author_association":"MEMBER","body":"We send developer marketing email to developers who check that box in their user profile (\"stay up-to-date with news and events\"). Sending the email is done through Salesforce, which has its own unsubscribe mechanism. After every mass mailing, we need to manually synchronize the unsbuscribe requests we get via that system with the AMO setting. For practical (and also legal) reasons, we need to make this synchronization automatic.\r\n\r\nA system called Basket has been setup so we can do this easily. Quoting pmac:\r\n\r\n> I think the easiest way forward will be to use basket's newsletter subscribe API endpoint[0] with the \"sync\" option. What this does is to tell basket to handle the request now rather than in an async task after the request has returned (which is the normal way it works for other subscribe forms). Because it does the subscription during the request it can and will return the user's token in the response. AMO could then store this token for use in creating the link to the email preference center on www.mozilla.org. Alternately you could use said token in a call to the unsubscribe[1] endpoint on behalf of the user if you'd rather.\r\n>\r\n> Because of the load to basket and the sensitive info returned when \"sync\" mode is on an API key is required when making this kind of call. I can generate such a key for AMO to use.\r\n>\r\n> If you'd like to just make a simple subscribe call when the user clicks the box and then fetch the token later that is also possible via the lookup-user endpoint[2]. An API key is also required for lookup-user when called with an email address.\r\n>\r\n> If your backend is written in Python we do have a client library you can use for these calls[3], but it's just simple HTTP POST requests if you need to write them yourself.\r\n>\r\n> [0] http://basket.readthedocs.io/newsletter_api.html#news-subscribe\r\n> [1] http://basket.readthedocs.io/newsletter_api.html#news-unsubscribe\r\n> [2] http://basket.readthedocs.io/newsletter_api.html#news-lookup-user\r\n> [3] http://basket-client.readthedocs.io/en/latest/usage.html\r\n\r\nAnd a followup:\r\n\r\n>> So, whenever the user loads their user management page on AMO, it would be best if AMO calls lookup-user to determine the state of the setting?\r\n>\r\n> You can do it that way, or better would probably be to have it behind another interaction that they had to do in order to tell the system that it needs to query their state. The lookup-user endpoint will return a list of subscribed newsletters, so you can check if they're subscribed or not. \r\n>\r\n>> Would we need an initial dump of the tokens for all subscribed users? \r\n>\r\n> I guess you would. We can provide you with a dump of users subscribed to a particular newsletter and you can load that state into your db. Said state can change however if users update their subscriptions via the email preference center linked at the bottom of every newsletter.\r\n"},"comment":{"url":"https://api.github.com/repos/mozilla/addons-server/issues/comments/391691449","html_url":"https://github.com/mozilla/addons-server/issues/7808#issuecomment-391691449","issue_url":"https://api.github.com/repos/mozilla/addons-server/issues/7808","id":391691449,"user":{"login":"AlexandraMoga","id":31961530,"avatar_url":"https://avatars3.githubusercontent.com/u/31961530?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexandraMoga","html_url":"https://github.com/AlexandraMoga","followers_url":"https://api.github.com/users/AlexandraMoga/followers","following_url":"https://api.github.com/users/AlexandraMoga/following{/other_user}","gists_url":"https://api.github.com/users/AlexandraMoga/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandraMoga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandraMoga/subscriptions","organizations_url":"https://api.github.com/users/AlexandraMoga/orgs","repos_url":"https://api.github.com/users/AlexandraMoga/repos","events_url":"https://api.github.com/users/AlexandraMoga/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandraMoga/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T12:12:12Z","updated_at":"2018-05-24T12:12:12Z","author_association":"NONE","body":"Stage is working as well:\r\n\r\n![image](https://user-images.githubusercontent.com/31961530/40484467-65b88748-5f64-11e8-8e8c-98652e606758.png)\r\n\r\nSince no other problems have been noticed in the meantime, I'm going to mark this issue as verified fixed on AMO -dev and stage with FF60, Win10x64"}}
{"actor":{"display_login":"AlexandraMoga"}}