
Example of WordPress monitoring notifications in Slack
Automated notifications from your WordPress site to your Slack, Mattermost and Google Chat channels.
Notify one or more webhook endpoints when things happen on your site: plugin installs and updates, post publication, comments, signups, PHP errors, WooCommerce sales, or anything you like via shortcodes, hooks and filter functions.
There is no limit to the ways you may integrate this plugin.
It supports all other Vanilla Bean plugins and is available for under-the-hood use as well as shortcode access.
[slackhooker text="Here is a message from my WordPress site"]
or
[slackhooker text="Here is a message" channel="general" username="My WordPress"]
or
[slackhooker text="Here is a message" channel="https://myorg.slack.com/services/xxoxlsodsfsfsdfds#channelname" username="My WordPress"]
Messages are queued last in the PHP process to ensure your other page processing is not interrupted, but you can override:
[slackhooker text="Here is a message from my WordPress." sendnow="true"]
Multiple or custom webhooks supported:
[slackhooker text="Here is a message to multiple webhooks" alsoto="https://hooks.slack.com/services/T03TDTbUF/BBG9SQV6X/abcdefghij,https://hooks.slack.com/services/T03TDTbUF/BBG9SQV6X/abcxxxxxxx"]
Simple text messages:
if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){
\VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification');
}
if(function_exists('\VanillaBeans\SlackHooker\vbean_slackhooker')){
\VanillaBeans\SlackHooker\vbean_slackhooker('Here is my notification','mychannel','Username',':specific_icon:');
}
if(function_exists('\VanillaBeans\SlackHooker\vbean_slacknotify')){
\VanillaBeans\SlackHooker\vbean_slacknotify(array('text'=>'Here is my notification','icon'=>':open_mouth:'));
}
Formatted data messages (NEW in 5.5.2):
if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){
$data = array(
'User ID' => '12345',
'Email' => '[email protected]',
'Status' => 'Active',
'Last Login' => '2025-10-03 14:30:00'
);
\VanillaBeans\SlackHooker\vbean_send_data('User Registration', $data);
}
Custom formatted messages with options:
if(function_exists('\VanillaBeans\SlackHooker\vbean_send_data')){
$data = array(
'Order ID' => '#WC-12345',
'Amount' => '$299.99',
'Customer' => 'John Doe',
'Payment Method' => 'Credit Card'
);
$options = array(
'color' => '#00ff00',
'pretext' => 'New WooCommerce Sale!',
'text' => 'Payment processed successfully'
);
\VanillaBeans\SlackHooker\vbean_send_data('E-commerce Sale', $data, $options);
}
Building custom attachment messages:
if(function_exists('\VanillaBeans\SlackHooker\vbean_build_data_message')){
$message = \VanillaBeans\SlackHooker\vbean_build_data_message('System Alert', array(
'Server' => 'web-01.example.com',
'CPU Usage' => '85%',
'Memory' => '3.2GB / 4GB',
'Disk Space' => '75% full'
), array('color' => '#ff9900'));
// Send using existing notification system
Vanilla_Bean_Slack_Hooker::notification_send($message);
}
There are defaults for all except the message. You can specify:
New Data Message Parameters (5.5.2):
We can be found at: