Blockspring Loves Slack

Blockspring shares an office space in San Francisco with the awesome Watsi team. Both of our teams use Slack for internal communication, but what we really wanted was a shared channel to discuss office issues, plan lunch outings and post cat facts.

Since Slack doesn't support creating a shared channel across teams we decided this would be another great dogfooding opportunity. In just a few minutes we created a function on Blockspring that connects two team's incoming and outgoing webhooks.

We built the fuction to be cloned and used by other teams like yours. Follow the steps in this post to get your teams chatting for free and without needing to set up any servers.

Get Started

  1. Clone the Cross Team Slack Chat block on Blockspring
  2. Modify the team configuration section by replacing team1domain and team1HookUrl with your team's slack domain ({teamdomain}.slack.com) and incoming webhook url. Replace team2domain and team2HookUrl with the information from the other team. Someone from the other team will have to send you their domain and webhook url.

    To create an incoming webhook

    1. Go to the New Incoming Webhook page: https://slack.com/services/new/incoming-webhook
    2. Select the channel you want shared or create a new channel.
    3. Click Add Incoming WebHooks Integration.
    4. Copy the Webhook URL from the following page. We'll need this later. It will look something like https://hooks.slack.com/services/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
  3. You should have something like this:

    teams = {
      "blockspring" => "https://hooks.slack.com/services/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",
      "watsi" => "https://hooks.slack.com/services/B026F7KEM/T02E6B1L4/2wOG2ijnfor3mZdrIMUFVW2W",
    }
  4. Important: Change the privacy dropdown from Public (Open Source) to Public (Closed Source).

  5. Click publish. Sign in or create a free account if you haven't already.
  6. On your new block page, click the Integrations tab and click the Webhook button. Copy the run.blockspring.com URL To your clipboard. It's the url that looks like this: https://run.blockspring.com/api_v2/blocks/c4c0dd9b473ebbeeff569753c5b1a891?api_key=cca9e50a9c3b5d92fa148ba0c28d2e94
  7. Create a new outgoing webhook: https://slack.com/services/new/outgoing-webhook
  8. Select the shared channel you created earlier
  9. Paste the run.blockspring.com url into the URLs box and click Save Settings
  10. Send the run.blockspring.com url to the other team and have them setup a similar outgoing hook.

Try it out!

Any messages sent in your channel will now be forwarded to the other team's channel.

Slack Screenshot

Customization

  • You can connect three or more teams with the same block by adding another entry to the teams configuration variable for each team.
  • If you don't want to share your Blockspring API key with the other team. Add someone from the other team as a collaborator on your Blockspring block and they will be able to call it with their own key.
  • Slack doesn't send real name or avatar urls within webhooks. By default, an random avatar will be assigned to each user before messages are forwarded. You can disable this by setting generate_avatars = false in the configuration section.
  • By default, team names will be appended to usernames in forwarded messages. Messages sent by jason from Blockspring will appear to be from jason (blockspring) to other teams. You can disable this feature by setting append_team_name_to_username = false in the configuration section.
Get Started with Blockspring