{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/328","repository_url":"https://api.github.com/repos/DoSomething/gambit-conversations","labels_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/328/comments","events_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/328/events","html_url":"https://github.com/DoSomething/gambit-conversations/pull/328","id":325064543,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5NDkyMTUz","number":328,"title":"WIP: Adds changeTopic macros to deprecate keyword content type [pr]","user":{"login":"aaronschachter","id":1236811,"node_id":"MDQ6VXNlcjEyMzY4MTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1236811?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronschachter","html_url":"https://github.com/aaronschachter","followers_url":"https://api.github.com/users/aaronschachter/followers","following_url":"https://api.github.com/users/aaronschachter/following{/other_user}","gists_url":"https://api.github.com/users/aaronschachter/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronschachter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronschachter/subscriptions","organizations_url":"https://api.github.com/users/aaronschachter/orgs","repos_url":"https://api.github.com/users/aaronschachter/repos","events_url":"https://api.github.com/users/aaronschachter/events{/privacy}","received_events_url":"https://api.github.com/users/aaronschachter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-21T21:24:54Z","updated_at":"2018-06-01T16:38:17Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/DoSomething/gambit-conversations/pulls/328","html_url":"https://github.com/DoSomething/gambit-conversations/pull/328","diff_url":"https://github.com/DoSomething/gambit-conversations/pull/328.diff","patch_url":"https://github.com/DoSomething/gambit-conversations/pull/328.patch"},"body":"#### What's this PR do?\r\n\r\nSupports adding additional content types available to save as the `reference` field on a `defaultTopicTrigger` entry:  `externalPostConfig`, `photoPostConfig`, or `textPostConfig` .\r\n\r\nThis deprecates the use for the `keyword` content type, as we're now associating each `response` reference with its own `defaultTopicTrigger` .\r\n\r\n\r\n* Queries Gambit Campaigns instead of Contentful for `defaultTopicTrigger` entries per https://github.com/DoSomething/gambit-campaigns/pull/1046 and moves these functions into a new `topic` helper, decoupling from the Rivescript creation in the `rivescript` helper\r\n\r\n* If a `defaultTopicTrigger` returned from a `GET /defaultTopicTriggers` request contains a `topicId` - return a new `changeTopic` macro that contains the reference Contentful ID, e.g. `changeTopicTo5MSUDKlVp6kqkUMw8gW004`\r\n\r\n\r\n#### How should this be reviewed?\r\nSet your Gambit Campaigns env vars to preview mode to test `defaultTopicTriggers` like SAFE, SAFETY, and POWER. Verify conversation topic is set to the relevant trigger's `response` entry ID and replies work as expected.\r\n\r\n#### Any background context you want to provide?\r\nOther gradual changes for future PR's:\r\n* If the conversation topic is set to `campaign`, set topic to the relevant topic (postConfig entry) ID instead\r\n* Signup messages will need to do the same thing, which means we'll need to know which topic ID to set\r\n* Adding `reminderConfig` reference to a `textPostConfig` or `externalPostConfig` to send after signup reminders via Customer.io\r\n\r\n#### Checklist\r\n- [ ] Documentation added for new features/changed endpoints.\r\n- [ ] Tests added for new features/bug fixes.\r\n- [ ] Tested on staging.\r\n"},"comment":{"url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/comments/393937912","html_url":"https://github.com/DoSomething/gambit-conversations/pull/328#issuecomment-393937912","issue_url":"https://api.github.com/repos/DoSomething/gambit-conversations/issues/328","id":393937912,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzkzNzkxMg==","user":{"login":"aaronschachter","id":1236811,"node_id":"MDQ6VXNlcjEyMzY4MTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1236811?v=4","gravatar_id":"","url":"https://api.github.com/users/aaronschachter","html_url":"https://github.com/aaronschachter","followers_url":"https://api.github.com/users/aaronschachter/followers","following_url":"https://api.github.com/users/aaronschachter/following{/other_user}","gists_url":"https://api.github.com/users/aaronschachter/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronschachter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronschachter/subscriptions","organizations_url":"https://api.github.com/users/aaronschachter/orgs","repos_url":"https://api.github.com/users/aaronschachter/repos","events_url":"https://api.github.com/users/aaronschachter/events{/privacy}","received_events_url":"https://api.github.com/users/aaronschachter/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T16:38:17Z","updated_at":"2018-06-01T16:38:17Z","author_association":"MEMBER","body":"Closing this to re-open as separate PR's:\r\n\r\n* Fetching defaultTopicTriggers from GambitCampaigns instead of Contentful per https://github.com/DoSomething/gambit-campaigns/pull/1046\r\n\r\n* Executing a `changeTopic` macro if a defaultTopicTrigger's response field is set to a topic entry (e.g. `textPostConfig`, `photoPostConfig`, etc) to deprecate the `keyword` content type\r\n"}}
{"actor":{"display_login":"aaronschachter"}}