Skip to main content

Drupal Meets Rocket Chat

A Detailed Exploration of Drupal-Rocket Chat Integration

Hodba Khalaf Cartoon image

Hodba Khalaf on 27 July, 2023

Rocket.Chat Drupal Module Logo

Introduction

In the dynamic landscape of Content Management Systems (CMS), Drupal has consistently demonstrated its prowess, offering a robust and flexible platform for developers and site builders alike. At the same time, Rocket Chat has emerged as an outstanding player in the realm of open-source team chat software, providing a comprehensive communication solution for diverse teams and communities and a great open-source alternative to popular platforms like Slack.

The integration of these two powerful tools, Drupal and Rocket Chat, is not just a combination of their features but a transformative upgrade to a Drupal site's communication capabilities. This integration brings the real-time communication abilities of Rocket Chat as a seamlessly integrated, fully-featured chat system into the Drupal environment, creating a seamless, enriched user experience.

In this detailed guide, we will navigate the Drupal-Rocket Chat integration module I developed for WITS agency in corporation with Think Modular. Regardless of whether you're a seasoned Drupal developer or a newcomer to the Drupal world, this guide will help you make aware of the features of this integration, use-cases and support you in making an informed decision to invest in this combination for a better user experience.

Defining Boundaries

What the Rocket Chat Integration Module Is Not

It is important to recognize the purpose of this module and what functionalities bring to Drupal and in which context. Here is what this module is NOT:

  • Not a Live Chat Solution: While the Rocket Chat Integration module provides seamless integration between Drupal and Rocket Chat, it does not include a "live chat" feature. For live chat functionality, users might need to consider other modules like the Rocket Chat module.
  • Not a Standalone Solution: This module is not a standalone solution. It requires both a Drupal environment and a Rocket Chat server or an active Rocket Chat subscription to function. It's designed to integrate these two platforms, not to replace or function independently of them.
  • Not a Substitute for Other Modules: This module is not intended to replace other modules that might offer similar features. It provides a unique set of features and integrations, and users should choose the module that best fits their specific needs.

Unveiling the Power

What the Rocket Chat Integration Module Is
  • A Seamless Integration Tool: The Rocket Chat Integration module is designed to provide seamless integration between the Drupal platform and the Rocket Chat communication platform. It embeds the full functionality of Rocket Chat directly into your Drupal website.
  • User and Group Management: The module offers robust user and group management features. It can synchronize Drupal users to the Rocket Chat server and provides multiple ways to create or update Rocket Chat accounts automatically, as the Drupal Users are used as the source of truth. It also allows the synchronization of Drupal groups to Rocket Chat private channels when used in combination with the Drupal Group module.
  • Flexible Configurations: The module provides a block with flexible configurations to open the chat in a new window, the Rocket Chat web app, and the Rocket Chat mobile app. It also offers a popup block with the same flexible configurations.
  • Integration with Other Modules: The module provides optional integration with the Ultimate Cron module and offers views integration for bulk creation or updating of Rocket Chat accounts and private channels.
  • Specialized Module Extensions: There are specialized extensions of the module for specific use cases. For example, the Rocket Chat Group module provides additional features for integrating with the Group module, and the Rocket Chat OpenSocial module offers features for integrating with the OpenSocial distribution.

Need Assistance Setting Up Your Rocket Chat Server?

Leverage my expert services for a smooth, hassle-free installation and configuration of your Rocket Chat server, ensuring optimal performance and security.

Use Cases

The Rocket Chat Integration module is ideally suited for Drupal sites with a large user base that requires advanced communication tools to enrich and enhance their interactive experiences.

Here are some examples of how different sectors that can leverage this module to their advantage:

  • Community Websites: For websites that host a community of users, the Rocket Chat Integration module can be a game-changer. It allows real-time conversations between members, fostering a sense of community. The module's ability to sync Drupal groups to Rocket Chat private channels can be particularly useful for creating dedicated chat spaces for different interest groups within the community.
  • Educational Websites: For educational platforms, the module can facilitate communication between students, teachers, and staff. It can be used to create private channels for different classes or study groups, and the OpenSocial integration can make the platform more interactive and engaging.
  • Business Websites: For businesses, the module can be used to improve internal communication. It can sync all employees' accounts from the Drupal site to the Rocket Chat server, allowing seamless communication. The module's integration with the Ultimate Cron module can help in automating and scheduling certain tasks.
  • Web Development Agencies: For web development agencies that build and manage Drupal sites for clients, this module can be a valuable addition to their toolkits. It can help them offer their clients a powerful, integrated communication solution. The agency can also offer services for setting up and configuring the Rocket Chat server, as well as the module itself.

Prerequisites

Before diving into the advanced configurations and customizations within the Rocket Chat Integration module, it is essential to ensure that you have all the prerequisites in place. This will facilitate a smooth and efficient setup process. Here are the prerequisites that you should have in place:

  1. Drupal Installation: A running Drupal installation is a prerequisite for using this module. The specific minimum version of Drupal compatible with the module is Drupal 9 and 10.
  2. Rocket Chat Server or Subscription: To use the integration, you either need a running Rocket Chat server or a paid subscription to Rocket Chat's services.
  3. Group Module (Optional): If you want to use the Rocket Chat Group module, the Group module must be installed on your Drupal site.
  4. OpenSocial Distribution (Optional): For those wanting to use the Rocket Chat OpenSocial module, the OpenSocial distribution must be installed.
  5. Ultimate Cron Module (Optional): The module provides optional integration with the Ultimate Cron module. Users who want to use this feature will need to have the Ultimate Cron module installed.

Once you have these prerequisites in place, you’re all set to harness the powerful combination of Drupal and Rocket Chat to provide a seamless and fully-featured communication experience to your site users. Proceed through this guide with the confidence that you have everything you need to get started.

Looking for Expertise in Installing, Hosting, Configuring, and Customizing OpenSocial?

Benefit from my extensive experience with OpenSocial, including close collaboration with their team on extensions like Zoom and BigBlueButton. I offer comprehensive services for OpenSocial, ensuring a tailored, efficient, and secure setup for your needs.

Basic Configurations

The basics of Rocket Chat Integration Module

When configuring the Rocket Chat server and its Drupal integration module, you'll encounter various options and settings. Let's understand how to have the basic settings that are needed for the integration to work:

Rocket Chat Server Configurations

  • Account Settings Configuration: Go to [rocket.chat.server]/admin/settings/Accounts and:
    • Disable "Two Factor Authentication"
    • Enable "Iframe"
    • Disable "Send email to user when a user is activated" and "Send email to user when a user is deactivated" under "Registration"
    • Set "Registration Form" to "disabled"
    • Optionally, adjust user account permissions to prevent users from changing their usernames, passwords, creating rooms, and channels. This is recommended as the module will manage these operations.
  • General Settings Configuration: Next, Go to [rocket.chat.server]/admin/settings/General and:
    • Enable "Enable Send" and "Enable Receive" under "Iframe Integration". You should use your Drupal domain name in "Send Target Origin" and "Receive Origins". For testing purposes, "*" can be used to allow all domains.
    • Enable CORS Origin under "REST API" and set it to your Drupal domain name. For testing purposes, this option can be disabled.
  • Permission Settings Configuration: Finally, Go to [rocket.chat.server]/admin/permissions, search for "token", and enable "Create Personal Access Tokens" and "User Generate Access Token" for the user role.

Rocket Server configurations | Settings
Rocket Chat Server configurations
Rocket Server configurations | 2FA
Rocket Chat Server configurations
Rocket Server configurations | 2FA
Rocket Chat Server configurations
Rocket Server configurations | Accounts
Rocket Chat Server configurations
Rocket Server configurations | Accounts 2
Rocket Chat Server configurations

Rocket Chat Module Configurations

  1. Configuring the Rocket Chat Server Credentials: After completing the Rocket Chat configurations, navigate to the module settings page on your Drupal site [YOUR DRUPAL SITE]/admin/rc/settings. Here, you should insert the following credentials:
    • Server URL: The Rocket Chat server URL with the protocol (e.g., https://example.rocket.chat)
    • Rocket Chat admin username: The username of the Rocket Chat admin
    • Rocket Chat admin password: The password of the Rocket Chat admin
    • Save the settings after entering the credentials.
  2. Configuring the Chat Accounts: Navigate to the user settings page [YOUR DRUPAL SITE]/admin/rc/user_settings.
  3. Automatically create a new chat account when a new user is registered: This option ensures that every new user on your Drupal site has a corresponding chat account in Rocket Chat.
    • Create or update a Chat account when a user logs in: This option ensures that a user's chat account is created or updated each time they log in, keeping their chat account in sync with their Drupal account.
    • Create a new Chat account when a user edits the account: This option creates a new chat account whenever a user edits their Drupal account, ensuring that any changes they make are reflected in their chat account.
    • Add chat admin to users with administrator role: This option automatically assigns the chat admin role to users who have the administrator role on your Drupal site.
    • Create chat accounts while running maintenance tasks: This option allows the module to create chat accounts while running cron jobs, which can be useful for maintaining synchronization between Drupal and Rocket Chat.
    • Update chat accounts while running maintenance tasks: Similar to the above, this option allows the module to update chat accounts while running cron jobs.
    • Show the Chat account ID and Token fields at the user edit form: This option displays the user's chat account ID and token fields on the form where they edit their Drupal account.
    • Show the Chat account ID and Token fields at the user "display" page: This option displays the user's chat account ID and token fields on their Drupal user page.
  4. Bulk Create/Update Chat Accounts: This option allows you to bulk create or update chat accounts associated with Drupal users. You can access this feature at [YOUR DRUPAL SITE]/admin/rc/people.
  5. Chat User Blocks: The module provides two blocks that use the Rocket Chat iFrame integration:
    • Chat User Block: This block can be placed in any region and comes with several configuration options, including iFrame URL, width, height, deep linking options, embedded chat option, and new window options.
    • Popup Chat User Block: This block provides an image or text trigger to open/close the chat block. It comes with the same configurations as the Chat User Block, with the addition of an icon image and text option for the trigger.
Rocket.Chat Drupal Module configurations 1
Rocket Chat Module configrations
Rocket.Chat Drupal Module configurations 2
Rocket Chat Module | Chat user settings
Rocket.Chat Module | Manage chat accounts
Rocket Chat Module | Manage Chat Accounts
Rocket Chat module blocks
Rocket Chat Module | Chat Blocks
Rocket Chat Module | Chat Block configurations
Rocket Chat Module | Chat Block configurations

Rocket Chat Group Module Configurations

The Rocket Chat Group module provides additional features for integrating Drupal groups with Rocket Chat channels. Here's how to configure it:

Configuring Groups and Chat Rooms
  1. Navigate to [YOUR DRUPAL SITE]/admin/rc/chat_groups_settings.
  2. Configure the "Group Settings". The options here are self-explanatory.
  3. Select the group types that you want to associate with Rocket Chat channels and click "Save".
  4. After saving, you will be able to associate the Drupal group type roles with the Rocket chat channels roles. The available channels' roles are "owner" and "moderator". Click "Save" again.
Bulk Create/Update Chat Channels

The module provides a way to bulk create or update chat channels associated with Drupal groups. To access this feature, navigate to [YOUR DRUPAL SITE]/admin/rc/rooms.

Chat Group Blocks

The module comes with a block that uses the Rocket Chat iFrame integration to present the Group channel on the group page. It has the following configurations:

  • iFrame width: the width of the iFrame
  • iFrame height: the height of the iFrame
  • (Experimental) Show a deep link to open the chat app using "https://go.rocket.chat": this option shows a link to open the web or mobile app using Deep Linking.
  • (Experimental) Show a deep link to open the chat app using "rocketchat://": Similar to the previous option where it uses "rocketchat://" as a protocol for deep linking.
  • Show the embedded version of the chat inside the iFrame: Activates the "Embedded" version of the Rocket Chat iFrame.
  • New window options: Allows opening the Rocket Chat iFrame in a new window. This option solves the problem of having a persistent chat window.

Remember to adjust the block visibility to be shown on the Group entities only.

These functionalities are central to configuring the Rocket Chat Group module's behavior in a Drupal environment. They are designed with flexibility and usability in mind, catering to a variety of group chat scenarios.

Rocket Chat group module 2
Rocket Chat Group Module | Manage chat group
Rocket Chat group module
Rocket Chat Group Module | Manage Cchat group

These functionalities are central to configuring Rocket Chat Integration Module's behavior in a Drupal environment. They are designed with flexibility and usability in mind, catering to a variety of payment scenarios.

Troubleshooting and Support

Encountering Issues or Need Further Assistance?

If you're facing any issues with the Rocket Chat Integration module, feel free to register a new bug report or feature request on the module issue log.

Also, if you need further assistance with its setup and configuration, don't hesitate to reach out. As an experienced developer and contributor to this module, I'm here to help you navigate any challenges you might encounter.

Interested in Supporting the Future of the Rocket Chat Integration Module?

The sponsorship can play a crucial role in this module's ongoing development and enhancement, ensuring it continues to meet the evolving needs of Drupal and Rocket Chat users. Be a part of this exciting journey and help shape the future of seamless communication integration.

Conclusion and Future Plans

The Rocket Chat Integration module is a powerful tool that bridges the gap between Drupal and Rocket Chat, providing a seamless, integrated experience. It's already packed with features, but the journey doesn't stop here.

Looking ahead, there are plans to enhance the module further and add new features. If you want to contribute to these future developments, consider sponsoring the module. Your sponsorship will support the ongoing development and maintenance of the module, ensuring it continues to evolve and meet the needs of its users.

Thank you for your interest in the Rocket Chat Integration module. Whether you're a user, a contributor, or a sponsor, your support is greatly appreciated. Together, we can make Drupal and Rocket Chat integration better than ever.