PHPackages                             nlybe/special\_notifications - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. nlybe/special\_notifications

ActiveElgg-plugin[Mail &amp; Notifications](/categories/mail)

nlybe/special\_notifications
============================

Extended notifications functionality on certain events for Elgg communites

06PHP

Since Nov 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/nlybe/Elgg-Special-Notifications)[ Packagist](https://packagist.org/packages/nlybe/special_notifications)[ RSS](/packages/nlybe-special-notifications/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Special Notifications plugin for Elgg
=====================================

[](#special-notifications-plugin-for-elgg)

[![Elgg 2.3](https://camo.githubusercontent.com/8452daaef3ea7320843e9a5473e44a80e23ec99b34525f2c9bbf8c83ccad0cd6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c67672d322e332d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/8452daaef3ea7320843e9a5473e44a80e23ec99b34525f2c9bbf8c83ccad0cd6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c67672d322e332d6f72616e67652e7376673f7374796c653d666c61742d737175617265)

Extended notifications functionality on certain events for Elgg communites.

This plugin can be used from developers for sending notifications to users automatically based on certain conditions, if these conditions are not being satisfied.

For example if a specific profile field is missing for current user, then this user should be notified.

Features
--------

[](#features)

- Option to register more events/conditions via hook
- Different notifications methods available

How to use
----------

[](#how-to-use)

1. Register hook for a new checking event with required options. Example:

```
elgg_register_plugin_hook_handler('special_notifications:config', 'notify', "snotify_profile_location");

function snotify_profile_location($hook, $type, $return, $params) {

    $key = 'profile_location';
    if (!$params || (is_array($params) && $params['notifier'] == $key)) {
        $return[$key] = [
            'active' => true,
            'hook' => 'profile_location_missing',
            'methods' => [SpecialNotificationsOptions::SN_METHOD_INLINE],
        ];
    }
    return $return;
}

```

2. Register a hook for checking if certain criteria are satisfied or not. If not then one or more notifications should be send to user. Example:

```
function special_notification_profile_location_missing($hook, $type, $return, $params) {
    if ($type !== 'user') {
        return;
    }

    $user = elgg_get_logged_in_user_entity();
    if (!$user) {
        return;
    }

    $key = 'profile_location';
    $settings = elgg_trigger_plugin_hook('special_notifications:config', 'notify', ['notifier' => $key], []);
    if (!$settings[$key]['active']) {
        return;
    }

    // check the condition for notify the user
    $notify = false;
    if (!$user->location) {
        $notify = true;
    }

    if ($notify) {
        $methods = $settings[$key]['methods'];
        foreach ($methods as $m) {
            switch ($m) {
                case "inline":
                    $close_btn = elgg_format_element('a', ['class' => 'close', 'data-dismiss' => 'alert', 'aria-label' => 'close'], '&times;');
                    $inline = elgg_view('special_notifications/inline',[
                        'content' => $close_btn.elgg_echo('special_notifications:profile_location:message'),
                        'class' => 'alert alert-warning fade in',
                    ]);
                    break;

                case "elgg_error":
                    register_error(elgg_echo('special_notifications:profile_location:message'));
                    break;
            }

        }

        if ($inline) {
            return $inline;
        }
    }

    return;
}

```

3. Trigger the hook anywhere on the site or after a specific event, e.g. after login. The example below can be inserted on profile page and display a warning:

```
if (elgg_is_active_plugin('special_notifications') && elgg_get_logged_in_user_guid()==$user->getGUID()) {
    if ($notifications = elgg_trigger_plugin_hook('special_notifications', "user", [], false)) {
        $content = elgg_format_element('div', ['class' => 'col-md-12 col-sm-12 col-xs-12'], $notifications);
    }
}
...
echo content;
...

```

As an example, a checking event is available on this plugin: Check if user has entered location on profile. If location is empty, then notify the user.

Future Improvements
-------------------

[](#future-improvements)

- Implement the 'elgg\_notification' method: use the standard Elgg notification method (notify\_user)
- Use annotation for saving user interaction. For example user should be able to select not to be notified again or to be notified after certain time.
- Add more native checking event for user notifications

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b3b4c3ed45bff26900a422f0271d660579bb6a309428222fabeedc2329b7979?d=identicon)[nlybe](/maintainers/nlybe)

---

Top Contributors

[![nlybe](https://avatars.githubusercontent.com/u/4714025?v=4)](https://github.com/nlybe "nlybe (1 commits)")

### Embed Badge

![Health badge](/badges/nlybe-special-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/nlybe-special-notifications/health.svg)](https://phpackages.com/packages/nlybe-special-notifications)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
