Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

INTRODUCTION

This module extends functionality of core messenger to handle situations when you want to leave a specific user with warning/error/info message on login event.

i.e. if system has applied an action against a user or any data related to him/her and you want to inform the user what happened beside any other notification method.

ROADMAP

I think this module can be more developed to

  • Admin may leave specific message to users based on role
  • not just leave a message on login but also on page refresh but i didn't check on performance of this
  • admin may leave a custom warning for specific user through a form.
  • Module structure can be more enhanced .

if you have an idea to extend, you are more than welcomed to create an issue.

REQUIREMENTS

This module requires no modules outside of Drupal core. but can be used with modules like Better Messages for better UX.

INSTALLATION

to get the module you can download and unzip it in contrib modules folder or better use composer to install the module and manage your dependencies:

 $ composer require drupal/private_messenger

CONFIGURATION

You need to create an private messenger entity whenever needed and module will load this entity on login and show message and remove the entity to not flood its table. in future i will add a simpler method to send the message.

 $message = \Drupal::entityTypeManager()->getStorage('private_messenger_message')->create([
   'type' => 'warning',
   'recepient_uid' => 5,
   'message' => 'Dear @name, please update your profile info asap.'
 ]);
 // Optional parameters in message.
 $message->setParameters(['@name' => 'name')]);
 $message->save();

IMOPORTANT NOTE

If you use version 1.3.0, you can send the message as 'message' => 'please update your profile info asap.', but in version 1.2.0 you have to send it within translation function 'message' => t('please update your profile info asap.'),

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
5
Tracked since
Jan 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.3.1 Stable Aug 6, 2023
1.3.0 Stable Aug 2, 2023
1.2.0 Stable Apr 10, 2023
1.1.0 Stable Mar 2, 2023
1.0.0 Stable Jan 23, 2023