Difference between revisions of "Configuring Notifications with Slack"
m (→Creating an App for Slack) |
|||
Line 57: | Line 57: | ||
WHMCS will attempt to automatically join your Bot to a Slack channel when one is defined in a Notification Rule. | WHMCS will attempt to automatically join your Bot to a Slack channel when one is defined in a Notification Rule. | ||
+ | |||
+ | ====Private Channels==== | ||
+ | To send notifications in private channels, follow these extra steps: | ||
+ | |||
+ | # Open the Slack app, | ||
+ | # Navigate to your private channel | ||
+ | # Invite the app to the channel with the command:<div class="source-cli">/invite @app_name</div>Replace <tt>app_name</tt> with the name of your app, eg:<br/><br/>[[File:Slack invite app.png]]<br/> | ||
+ | # Send the message | ||
+ | The app will join the private channel, and now be available for selection in WHMCS when [[Notifications#Creating_a_Notification_Rule|creating a Notification Rule]]. |
Revision as of 12:19, 26 February 2021
Configuring Notifications with Slack allows you to receive notifications in your Slack channels when events occur within WHMCS.
For more information on Notifications, please refer to the Notifications Documentation.
Configuring Slack Notifications
To enable WHMCS to communicate with the Slack API, WHMCS requires an OAuth Access Token.
You can create an OAuth Access Token quickly and easily by following the steps below.
Creating an App for Slack
1. Begin by logging into your Slack Workspace
2. Visit https://api.slack.com/
3. Click the Start Building button to start the process of creating a new app. You will need to login if you haven't already.
4. Enter a name for the app. We recommend something like 'WHMCS'. Also choose the workspace you wish to add the app to. Then click continue.
5. Under the Add features and functionality heading, select the Permissions option
6. Scroll down to Scopes: Bot Token Scopes
7. Click "Add an OAuth Scope" and assign the following permissions:
- channels:join
- channels:read
- chat:write
- groups:read
9. Click Install App to Workspace
9. Confirm you authorize the permissions for the app that you just configured.
10. You will now be presented with the Bot User OAuth Access Token you need for WHMCS integration. Copy this value.
11. Now return to WHMCS and navigate to Setup > Notifications.
12. Under the Slack notification provider, click Configure
13. Enter the Bot User OAuth Access Token you copied in step 10 into the OAuth Access Token input field and hit Save Changes to complete the process.
WHMCS will attempt to verify the OAuth Access Token provided and automatically join your App . If the verification fails you will receive an error message. Check the Access Token is entered correctly, has all the required scopes and try again. If successful, the modal will close and you will now be able to send notifications to Slack.
You are now ready to Create Your First Notification Rule.
WHMCS will attempt to automatically join your Bot to a Slack channel when one is defined in a Notification Rule.
Private Channels
To send notifications in private channels, follow these extra steps:
- Open the Slack app,
- Navigate to your private channel
- Invite the app to the channel with the command:/invite @app_nameReplace app_name with the name of your app, eg:
- Send the message
The app will join the private channel, and now be available for selection in WHMCS when creating a Notification Rule.