Custom Slack App

Create your own app

This feature is in beta. We'd love your feedback — please get in touch and let us know how it can be improved.

If you're curious what our team is working on, see our roadmap and follow us on Twitter!

Create and install your own app into your Slack workspace

  • Create a Slack application and obtain an oauth key.
  • Send us your oauth key (encrypt it with our public PGP key).
  • Verify the Slack channel in MagicBell is enabled

Create a Slack application and obtain an oath key

Head over to https://api.slack.com/apps and click on the "Create New App" button

Name your Slack app to something that makes sense to you, eg MagicBell, select the workspace you'd like to install it to and cleck on Create.Under the Basic Information section, click on the "Bots" section. Next we'll assign the required scopes to your bot token to ensure messages reach the correct recipients.Click on the "Review Scopes to Add" button.Under the "Bot Token Scopes" add the following scopes:The only thing remaining is to install the app to your workspace:Click "Allow"This takes you to the OAuth & Permissions page. From here copy the Bot User OAuth Token from the OAuth Tokens for Your Workspace section and send it over.

Verify the Slack channel in MagicBell is enabled

Go to https://app.magicbell.com/projects/project_id/channels and ensure that the Slack channel is enabled.

Send a notification to a Slack user/channel

Once your account is set up, MagicBell will automatically deliver Slack notifications through your Slack app, no additional work is needed. To send a message to a Slack Channel use the Channel's ID as the external_id. To send a DM in Slack you can use the user's email address.

{
  "broadcast": {
    "title": "Welcome to Example Inc",
    "recipients": [
      {
        "email": "dan@example.com",
        "external_id": "AB1234BCA"
      }
    ],
    "custom_attributes": {
      "name": "Dan",
      "company": {
        "name": "Example Inc"
      }
    }
  }
}

Distribute your app to your end users

One you've tested the integration between MagicBell and Slack, you can distribute your application to your end users. Currently you need to contact MagicBell when your app installed into a Slack workspace. We will set up the installed Slack app in MagicBell's backend. We're working on providing an API for this in the near future.

Manifest App

  1. Go to https://api.slack.com/apps and click on the "Create New App" button.
  2. From an App Manifest, click on "From an app manifest" and select "Create App Manifest"
bash
display_information:
  name: NotificationBot
  background_color: "#5a6482"
features:
  bot_user:
    display_name: Notifier
    always_online: false
oauth_config:
  redirect_urls:
    - https://4b9481c607d1d8ff.ngrok.app/integrations/slack/auth/callback
  scopes:
    bot:
      - commands
      - chat:write
      - users:read.email
      - users:read
      - channels:read
      - incoming-webhook
settings:
  org_deploy_enabled: false
  socket_mode_enabled: false
  token_rotation_enabled: false
  • Grab the credentials AppID, ClientID and ClientSecret and use our API or the dashboard to set them up.
  • Click on the "Manage Distribution" tab, review the checlist and click "Activate Public Distribution" to ensure that your app can be installed across many workspaces.