Slack Chat: Chatting with Visitors on a Drupal Site

Since we switched to Slack as the primary means of communication at work, Slack has grown to be my favorite chat application. Not only does it have a very pleasant interface, but it also offers great ways to integrate it with your application. As a matter of fact, their API is among the least restrictive ones in my experience. As a result of the joy of working the Slack API, Slack chat module was born to serve as a proof of concept for embedded Drupal-to-Slack chat functionality.

Using Slack chat module, you can add a chat widget to your Drupal site that your visitors can use to chat with users in Slack. This can allow you to provide live chat customer support to your visitors directly from Slack, without having to log in to the Drupal site. The module creates a channel in Slack for each visitor, so multiple people in Slack can join or oversee the conversation. 

Slack chat module

The module depends on Node.js integration module to deliver messages to the visitor in real-time. Once Slack chat module is installed, the Node.js server application (part of Node.js integration module) acts as a Slack bot that's constantly online and processes events coming from Slack.  Another approach I considered for this purpose was outgoing webhooks. However, I found that too limiting because outgoing webhooks only trigger in a specific channel, or for messages prefixed with a certain word. It would have been cumbersome to have all visitors chat in the same channel, or require Slack users to prefix all messages with a command word. The Slack bot approach, on the other hand, provides for a seamless experience and also precludes the need to constantly poll for new messages.

If you use Slack and have a website, be sure to check out Slack chat module, and let me know your thoughts. 

Comments

Awesome! This is really interesting. Will definitely look into this, have had this request in the past. Any chance a D8 version is on the roadmap somewhere?

Thanks! Yes, definitely. It looks like the module is generating some interest, so I'll start the D8 branch soon.

Aces! I'll keep an eye on the project, and help out if I can, have experience with D8 including minor experience with the NodeJS module.

Something that wasn't especially mentioned, is there some sort of way to find out if there is at least 1 person online in the slack notification channel, to start a conversation with. Else there isn't much use in starting a channel, when noone is available to chat.

It is not checked whether anyone is online at this time, but one of the next releases is planned to do that and hide the start chat button when there isn't anyone to chat with.

Thank you!! Nice to see this feature available

Add new comment