Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Send message to Slack
This module is designed for web-developer/ops. Using Incoming WebHooks to send messages to slack for notifying. It's very easy to set notifier in follow steps:
How to use
- Go to Slack services page.
https://projectname.slack.com/services/new - Choose Incoming WebHooks.
https://projectname.slack.com/services/new/incoming-webhook - Pick any channel.
Note: You could input others in this module/function. - Copy Webhook URL to this module's settings page from Slack services page.
- Go to Drupal setting page to set defaults.
http://yoursite/admin/config/ucdapp/notify_slack - Congrats! Now you could use this module to send message to Slack.
Examples & Test
Test our feature as follow page:
http://yoursite/notify_slack/form
Note: "Channel" field need to add "#" as prefix value.
Example code:
<?php
// Send message by passing only strings.
notify_slack("Your messages");
// Send with Slack settings.
notify_slack(array(
'link_names' => 1, // 1: To show your mentions as a link; 0: is opposite.
'username' => 'Shrek', // Slackbot custom name to instead.
'icon_emoji' => ':ghost:', // Bot avatar. could be Emoji or image's url.
'channel' => '#random', // The channel you want to send.
'text' => "Your messages.", // Passing strings as you message to notify slack.
));
?>
The function notify_slack
could be use in some errors and users feedback to notify Ops as well.
Now you can enjoy what is email-free feel like. Cheers!
Project information
- Module categories: Administration Tools, Developer Tools, Security
- 18 sites report using this module
- Created by Albert.Liu on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
7.x-1.3
released 13 January 2016
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
Add avatar option feature.
Development version: 7.x-1.x-dev updated 13 Jan 2016 at 00:53 UTC