From 843dbbf3a1a5f2e47f4ebe89e5e0b63d48076f04 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Mon, 19 Jun 2017 22:22:48 -0230 Subject: [PATCH] webhooks/slack: Restructure docs to use create-stream.md macro. --- zerver/webhooks/slack/doc.md | 43 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/zerver/webhooks/slack/doc.md b/zerver/webhooks/slack/doc.md index a3fb5cd446..f44db06395 100644 --- a/zerver/webhooks/slack/doc.md +++ b/zerver/webhooks/slack/doc.md @@ -5,12 +5,29 @@ There are two ways in which you may want to receive a notification: - Slack Channel to a single Zulip stream with different topics - Multiple Zulip streams for multiple Slack channels -If you want a single Zulip stream to receive notifications from Slack then -first create your desired stream and subscribe all interested parties to -this stream. We recommend the name `{{ integration_name }}`. +### Single stream with different topics + +{!create-stream.md!} {!create-bot-construct-url.md!} +If you'd like to receive notifications to a single stream with +different topics for different Slack channels, append +`&channels_map_to_topics=1` to the above URL. + +### Multiple Zulip streams for multiple Slack channels + +First, create streams for all of your Slack channels. Make sure that +the name of a given stream is the same as the name of the Slack channel +it maps to. + +{!create-bot-construct-url.md!} + +If you'd like your Slack channels to be mapped to multiple Zulip +streams, append `&channels_map_to_topics=0` to the above URL. + +### Configuring the webhook + Go to the following URL: Next, under the category of App features click on @@ -22,8 +39,8 @@ Now, click on **Outgoing Webhooks** under **Custom Integrations**. ![](/static/images/integrations/slack/002.png) -Then click the hyperlink **outgoing webhook integration** which can be found -in the page. +Then click the hyperlink **outgoing webhook integration** which can be +found in the page. ![](/static/images/integrations/slack/003.png) @@ -31,22 +48,14 @@ Next, click the **Add Outgoing Webhook integration** button. ![](/static/images/integrations/slack/004.png) -Now, under `Integration Settings`, fill in the channel you'd like to get your -notifications from. +Now, under `Integration Settings`, fill in the channel you'd like +to get your notifications from. -Then fill in -`{{ external_api_uri_subdomain }}/v1/external/slack?api_key=abcdefgh&stream=slack&channels_map_to_topics=1` -as your URL. Finally, save your settings. +Then fill in the URL created above as your URL. Finally, save your +settings. ![](/static/images/integrations/slack/005.png) -In case you want your Slack channels mapped to multiple Zulip streams, you have -to change the parameter `channels_map_to_topics=1` to `channels_map_to_topics=0` -in your URL. - -The resulting URL will be -`{{ external_api_uri_subdomain }}/v1/external/slack?api_key=abcdefgh&stream=slack&channels_map_to_topics=0` - {!congrats.md!} ![](/static/images/integrations/slack/006.png)