Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Private Messenger

Security covered Under active development 16 sites

This module allows administrators to display specific warning, error, or informational messages to users upon login. It's designed to inform users about actions taken concerning their account or related data.

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.'),

Drupal 8–10 · not 11

Ask your assistant about Private Messenger

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • text Drupal core

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 PHP Release date
1.3.1 Stable 8–10 Aug 6, 2023
1.3.0 Stable 8–10 Aug 2, 2023
1.2.0 Stable 8–10 Apr 10, 2023
1.1.0 Stable 8–10 Mar 2, 2023
1.0.0 Stable 8–10 Jan 23, 2023