firesphere / stripeslack
Easy invite new users to your slack group
Installs: 828
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 2
Type:silverstripe-vendormodule
Requires
- silverstripe/cms: ~3.1
- silverstripe/framework: ~3.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-16 07:08:33 UTC
README
Inviting users to your public Slack channel is pretty hard to automate.
This module intents to make it at least a bit easier.
Although the initial steps seem overwhelming, I've tried to write it out as detailed as possible. Once you've done it once, the next time will be a breeze.
Why StripeSlack
Unlike other services that are require a third party to have full administrative access to your Slack Workspace, StripeSlack is under your full control. You don't need to trust a third party to be trustworthy and not operate simply to collect email addresses.
Although the submissions are stored in the database, this is on your own server. The reason for storing is so you can re-send invites if something went wrong.
Disclaimer
Unless you add a checkbox asking the user to also sign up for your newsletter, this module is explicitly not intended to add this functionality and therefore, please do not abuse the storage of email addresses for this purpose.
Be a decent human being.
Prerequisites
Somebody in your team needs to be an admin on your Slack usergroup, or have contact with an admin, to have it set up.
Caveats
It looks pretty hard to get it all set up with Slack. You'll need to jump through quite some hoops. Please follow the instructions closely. When done, you'll find it wasn't actually that hard after all, just a few steps that seem somewhat confusing at first.
Installation
- Option 1, with Composer:
composer require firesphere/stripeslack
- Option 2, download:
Download the zip from GitHub
Finally, run https://yourdomain.com/dev/build?flush=all
Setting up Slack
Note:
- To do this, you need to be an admin on the slack channel.
- The administrator taking the steps will be the person who will be sending out the invites.
- Don't be taken aback by the amount of steps. I've tried to be as detailed as possible.
- Go to the Slack API site.
- Scroll down to the Authentication heading and click on Register your application.
- You'll be presented with a Modal where you can give the app a name and a dropdown to select the group you want the application to work for.
- After creation, you'll be presented with the Basic Information screen.
- Click on Add features and functionality.
- Click on Permissions.
- Scroll down to Redirect URLs.
- Enter the URL from where the application will operate, e.g.
https://www.silverstripe.org
. Preferably it's anhttps
site. - Click on the Save URLs button.
- Scroll further down to Scopes.
- Under Select Permission Scopes, select Administer the workspace.
- Click on Save changes.
- Scroll back up to the top and click the button Install App to Workspace.
- On the left, click on Basic Information to go back to the basic information.
- You are now done setting up Slack.
Setting up StripeSlack
After setting up Slack, a few more steps are needed.
- In a new tab or window, open your CMS and go to Settings.
- Select the Slack tab.
- Enter the url of your Slack Workspace (e.g.
https://silverstripe-users.slack.com
). - Select the default channel you want your users to be invited for (Usually General).
- You can get the ID by right clicking on your channel and select "copy link".
- Open the copied link in a browser and copy the part after "messages/".
- Paste this code in to ID of your channel field.
- Go back to your Slack application on the Basic Information and scroll down to see the App Credentials.
- Copy the Client ID.
- Paste the Client ID in the CMS in the Client ID field.
- Back to the Slack Application, click on show under Client Secret.
- Copy the now visible Client Secret.
- Paste the Client Secret in the CMS Client Secret field. (Note that it's pasted as a password, don't worry, it's stored correctly).
- Select a page on your website to redirect the user to, when the invitation has been sent successfully and one for when it was unsuccessful.
- Save the site settings
- You will now be presented with a link to click, to Authorize your application.
- Click the link to be redirected to Slack, which will ask you for Administrator Privileges for this app.
- The privileges are fully under your control, and the app is installed locally
- No third party will get administrative access.
- This repository does not collect any data from you.
- After accepting, you will be redirected back to the CMS. Your application is now ready to go.
Adding the form to your website
You can create a StripeSlackPage type, which will help you set up everything. It allows you to set the success and error message as well.
If you want to place the signup-form in the footer for example, you can, at the place of choice to add the form,
simply include $SlackForm
in your template (You might need to add $Top
if needed) and the form should appear.
Textual changes can be made in a translation file in your base project. See stripeslack\lang\en.yml
for an example.
Styling and design of the form
The form relies completely on the provided FormField
templates. So styling is all up to you.
Todo
- [|] Add tests
- Make invites sent to a certain channel
- Re-try sending invites via the CMS
- Move away from
RestfulService
(Removed in SS4) to usingGuzzle
- SilverStripe 4 compatible version
- Add a shortcode to use [slackform] from the CMS
Cow?
/( ,,,,, )\
_\,;;;;;;;,/_
.-"; ;;;;;;;;; ;"-.
'.__/`_ / \ _`\__.'
| (')| |(') |
| .--' '--. |
|/ o o \|
| |
/ \ _..=.._ / \
/:. '._____.' \
;::' / \ .;
| _|_ _|_ ::|
.-| '==o==' '|-.
/ | . / \ | \
| | ::| | | .|
| ( ') (. )::|
|: | |; U U ;|:: | `|
|' | | \ U U / |' | |
##V| |_/`"""`\_| |V##
##V## ##V##
License
Copyright 2017 Firesphere
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License of third party
The image used for Slack in the CMS is the grayscale image provided by Slack as their official image to use. Copyright of image is with Slack Ltd.