0.0
The project is in a healthy, maintained state
Slack messaging with background dispatch with automatic rate-limit retries.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.1.0.pre.alpha.4.1, < 0.2.0
 Project Readme

SlackSender

Reliable Slack messaging for Ruby — with automatic retries, rate-limit handling, and sandbox safety.

SlackSender handles the plumbing so you can focus on your application: background dispatch, retry logic, multi-workspace support, and development environment redirects are all built in.

Installation

Add to your Gemfile:

gem 'slack_sender'

Then run:

bundle install

Requirements:

  • Ruby >= 3.2.1
  • A Slack Bot User OAuth Token with chat:write scope (see Configuration for full scope list)
  • For async delivery: Sidekiq or ActiveJob (auto-detected)

Quick Start - Minimal

SlackSender.register(token: ENV['SLACK_BOT_TOKEN'])
SlackSender.call!(channel: "some_channel_name", text: "Hi there")

Quick Start - Realistic

1. Register a Profile

SlackSender.register(
  token: ENV['SLACK_BOT_TOKEN'],
  channels: {
    ops_alerts: 'C1111111111',
    deployments: 'C2222222222',
  },
  sandbox: {
    channel: { replace_with: 'C_DEV_CHANNEL' }  # Redirects in non-production
  }
)

2. Send Messages

# Async (recommended) — background job with automatic retries
SlackSender.call(channel: :ops_alerts, text: ":rotating_light: High error rate detected")

# Sync — when you need the thread timestamp
thread_ts = SlackSender.call!(channel: :deployments, text: ":rocket: Deploy started")
SlackSender.call(channel: :deployments, text: "Deploy complete!", thread_ts:)

That's it. SlackSender handles rate limits, retries, and sandbox redirection (if configured, all messages sent from non-production environments will be delivered to your replace_with channel) automatically.

Documentation

Guide Description
Usage Guide Messages, files, threading, multi-channel delivery
Configuration Profiles, sandbox mode, global settings
Axn Integration use :slack strategy and SlackSender::Notifier
Troubleshooting Common errors and FAQ

Features

  • Background dispatch with automatic rate-limit retries via Sidekiq or ActiveJob
  • Multi-channel delivery — broadcast to multiple channels efficiently
  • Sandbox mode — redirect or suppress messages in non-production environments
  • File uploads — sync and async, with automatic size handling
  • Multiple profiles — manage multiple Slack workspaces
  • Axn integrationuse :slack strategy and dedicated Notifier base class

Development

bin/setup         # Install dependencies
bundle exec rspec # Run tests

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/teamshares/slack_sender.

License

The gem is available as open source under the terms of the MIT License.