Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Notify Widget

115 sites Security covered Drupal 10–11
View on drupal.org

This module adds a notification widget to your site, displaying an icon with a count of unread messages. Notifications link directly to their content and are automatically marked as read upon clicking. It also provides a service to send notifications to single or multiple users programmatically.

Provides a notifications widget that adds a notifications icon to the page for the user to access their notifications. The icons displays an iOS style red badge containing the number of unread notifications, and each notification has a click-thru link that automatically sets the notification status to read when clicked.

The module also provides a service (notify_widget.api) that has a send() method and it is this method that should be used to set up notification for users, eg.

Sending to a single user

\Drupal::service('notify_widget.api')->send(
  '<module_name>',
  'warning',
  'Password Expiry!',
  'Your password is about to expire in 5 days.',
  1,
  '/user/pasword'
);

Sending to multiple users

\Drupal::service('notify_widget.api')->send(
  '<module_name>',
  'warning',
  'Password Expiry!',
  'Your password is about to expire in 5 days.',
  [1, 2, 3],
  '/user/pasword'
);

The first example will set a notification for user 1 (top admin), notifying them of the fact that their password will soon expire, and the notification will link to the user password page. The first argument is the "source" argument, and can take any value, but it is suggested to use the name of the module that sets the notification. As yet, the value is unused, but may be used in the future to filter notifications.

The second example above will send the same notification, but it will go to users 1, 2, and 3.

To display the notifications on the site, go to the block layout page and add the "Notify Widget" block to a region on your site. Set the block so that it only displays for authenticated users.

The notify widget settings can be reached under Configuration > System > Notify Widget Settings, and settings include the maximum number of notifications and whether to use the CSS included with the module or not. If you choose not to use the CSS provided, you must style the notifications in your own theme.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Dec 2024
Latest release
7 months ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.15 Stable 10–11 Jan 15, 2026
1.0.13 Stable 10–11 Jan 14, 2026
1.0.12 Stable 10–11 Dec 17, 2024