de_notifications
The Decoupled Entity Notifications module provides a robust API for subscribing to entity updates, enabling seamless integration with decoupled frontends.
Features
- Subscription Management: Allows users to subscribe to changes in specific entities.
- Customizable Notifications: Introduces a `notifications_settings` field that can be added to entity bundles. This field includes:
- A subfield to control whether an entity can be subscribed to.
- A user-configurable subfield for sending notifications on specific changes, along with a text field for detailed descriptions.
Typical usecase for this module is receiving updates for entity changes with a decoupled frontend.
Post-Installation
Follow these steps to set up the Notifications module:
- Enable the Module: Install and enable the module in your Drupal site.
- Set the Secret Key: Add the following line to your `settings.php` file, replacing `{SECRET_KEY}` with a secure, private value. Using an environment variable for this key is highly recommended.
$config['de_notifications.settings']['secret_key'] = {SECRET_KEY};
- Configure Module Settings: Go to `admin/config/system/de_notifications` to adjust the module’s settings.
- Set Up Cron Jobs: Configure the desired schedules for the "Clean up unconfirmed subscriptions" and "Queue: Notify Subscribers" cron jobs in your site's cron settings.
- Add the Notifications Field: Add the `notifications_settings` field to the desired entity bundle(s).
- Enable the Field: Activate the added field for one or more instances of your entity.
- Use the Endpoints: Make API requests to the module’s available endpoints as outlined in the documentation.
Additional Requirements
The Decoupled Entity Notifications (DEN) module requires:
DEN comes bundled with the submodule Decoupled Email Notifications Symfony Mailer (DENSM) to allow you to use symfony mailer as a notification type. If you plan to use DENSM, you'll also need to install the Symfony Mailer module.
The modular architecture of DEN is designed for extensibility, allowing developers to create additional notification type submodules as needed.