Configuring Notifications with Slack
Configuring Notifications with Slack allows you to receive notifications in your Slack channels when events occur within WHMCS.
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
To create a Slack app:
- Log in to your Slack Workspace.
- Go to https://api.slack.com/.
- Click Create an app. You will need to log in if you haven't already.
- Select From scratch.
- Enter a name for the app. We recommend something like WHMCS.
- Choose the workspace you wish to add the app to and click Continue.
- Under Add features and functionality, select Permissions.
- Scroll down to Scopes: Bot Token Scopes.
- Click Add an OAuth Scope and assign the following permissions:
- Click Install App to Workspace.
- Confirm authorization for the permissions for the app that you just configured.
- Copy the Bot User OAuth Access Token value. You will need this to enter in WHMCS.
- In WHMCS, to go Configuration () > System Settings > Notifications or, prior to WHMCS 8.0, Setup > Notifications.
- Under the Slack notification provider, click Configure.
- Paste the Bot User OAuth Access Token that you copied into OAuth Access Token.
- Click Save Changes.
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. For example:
- Send the message
The app will join the private channel, and now be available for selection in WHMCS when creating a notification rule.