Can not notify through all available channels

Created on 16 August 2016, almost 8 years ago
Updated 15 January 2024, 5 months ago

Problem/Motivation

In the example module there is the snippet:

...
message_notify_send_message($message, $options);
...

In the documentation:

Support for email and SMS message notifications

This example works by default, however it only uses the email plugin to notify (whoever it is), due to the default third parameter.
This module is advertised as a notification/messages framework, but there is no broadcast notification through all channels enabled for a message type, so it will make the notification if you develop it.

For example:
User has subscribed to both email and SMS, so to actually notify him on both channels a developer will have to script all the notifications code. for email and then for SMS.

Now imagine you have multitude of notification events and notification channels. You are adding new notifiers to the system. All existing code will have to be revised and add this new particular notification as it is now.

In my eyes this is NOT plug-able and it is making the usage of the module more complex than it needs to be.

Proposed resolution

Either provide a new function to notify list of notifier plugins or change the API of the message_notify_send_message to accept string (as now) and array (addition) so it can go through and notify for each of them.

Taken the broadcast route with the proposal in #2, implementation in #3.

Remaining tasks

What's left is to have a configuration page for:
- Pick a default notification provider instead of the hard-coded email at the moment.
- Expose the list of notifier plugins for the broadcast one as configuration UI.

Discussion, patch anything else.

User interface changes

New configuration page.

API changes

None - this is API addition.

Data model changes

None.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡¬Bulgaria ndobromirov

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024