0.0
No commit activity in last 3 years
No release in over 3 years
Easily automate your Slack team invitations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.0
 Project Readme

SlackInviter

Gem Version

Build Status Code Climate Coverage Status

Easily automate your Slack team invitations.

Use this gem with you Rails, Sinatra or any Ruby application.

Installation

Add this line to your application's Gemfile:

gem 'slack_inviter'

And then execute:

$ bundle

Or install it yourself as:

$ gem install slack_inviter

Configuration

Before inviting your new users you need to configure the SlackInviter with you team and API token using the following script:

SlackInviter.configure do |config|
  config.team = 'team_domain'
  config.token = 'api_token'
end

If you are using Rails we recommend adding the above script to config/initializers/slack_inviter.rb.

Make sure you fill the configurations above with the proper values for your Slack team.

You can get more information on generating a Slack API token on Slack's Help Center.

Usage

SlackInviter.invite('me@example.com') # => true

If everything goes well you should expect the above command to return true, otherwise it will raise a SlackInviterError that inherits from Ruby's StandardError.

The SlackInviterError message will contain the error returned by the Slack API and can be used to understand what happened. Currently it may be one of the following:

  • already_in_team - User is already a member
  • already_invited - User haven't accepted the invitation yet
  • invalid_email - The email provided was considered invalid
  • invalid_auth - The token provided for this team is not valid

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/diego-silva/slack_inviter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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