SlackSandbox (slack_sandbox v0.1.0)

Copy Markdown View Source

A Swoosh-style local mailbox, but for Slack.

Implements SlackSandbox.Adapter by capturing every post_message/2 and send_dm/2 call into SlackSandbox.Inbox instead of hitting the real Slack API, so you can point your app at it in dev/test and watch outbound messages arrive live in SlackSandbox.InboxLive.

Setup

  1. Add SlackSandbox.Inbox to your supervision tree:

    children = [
      {SlackSandbox.Inbox, pubsub: MyApp.PubSub}
    ]
  2. Point your app's Slack adapter config at SlackSandbox in dev:

    # config/dev.exs
    config :my_app, :slack_adapter, SlackSandbox
  3. Mount the inbox page in your router:

    live "/dev/slack-inbox", SlackSandbox.InboxLive

Everything your app sends through the configured adapter now shows up at /dev/slack-inbox in real time, no Slack workspace required.