Over the past years, Slack has become a favorite communication tool for thousands of companies, averaging more than 250,000 daily active users, 30% of which are using paid service.
While Slack helps teams work together on a single target, the bulk of the actual work takes place outside of the app. For this reason, Slack API offers the possibility to add new Incoming WebHooks for integration with external services. Given that WordPress has 27% + sites in the world, it is very important to have an easy way to receive notifications from these sites.
For standalone WordPress Slack plugin, assemblies exist, created by Akeda Bagus, the developer of the X-team. The day before yesterday we talked about the bbPress Slack Integration plugin, which allows you to send notifications about new topics and replies to your selected bbPress Slack channel. WP Slack performs a similar function for the common WordPress events.
The plugin is able to send notifications to Slack on the basis of the following events:
- When recording requires an examination (status “pending review”)
- When an entry is posted
- When a new comment is posted
In addition, the plug-in also includes slack_get_events filter to add more events. The documentation contains an example of creating a new event that will notify Slack when the user logs on to the website:
add_filter( 'slack_get_events', function( $events ) { $events['user_login'] = array( 'action' => 'wp_login', 'description' => __( 'When user logged in', 'slack' ), 'message' => function( $user_login ) { return sprintf( '%s is logged in', $user_login ); } ); return $events; } );
Configuration of WordPress admin panel is simple. Once you connect to Slack, you will need to simply paste the WebHook URL in the Service field URL:
WP Slack allows you to specify multiple integrations, so you can send notifications to different channels. Notifications can be temporarily deactivated and later incorporated back. When you finish the setup integration process, the plug-in will allow you to send a test alert to make sure that everything is working correctly.
Bagus has also developed a set of free extensions that send notifications based on events initiated by other plugins:
- Slack EDD
- Slack WooCommerce
- Slack Contact Form
- Slack Gravity Forms
These plug-ins will allow your team to receive all notifications of new orders in WooCommerce and the EDD, about requests sent through the contact form on your site, etc. All these extensions require the installation of Slack plugin.
Slack Plugin for WordPress is available in the official plugins directory. You can also find the project on GitHub.