PHPackages                             hypejunction/notifications\_editor - 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. hypejunction/notifications\_editor

AbandonedArchivedElgg-plugin

hypejunction/notifications\_editor
==================================

Notification Editor for Elgg

1.0.0(10y ago)110[1 issues](https://github.com/hypeJunction/Elgg-notifications_editor/issues)GPL-2.0PHPPHP &gt;=5.5

Since Jan 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hypeJunction/Elgg-notifications_editor)[ Packagist](https://packagist.org/packages/hypejunction/notifications_editor)[ Docs](http://hypejunction.com)[ RSS](/packages/hypejunction-notifications-editor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Notification Editor for Elgg
============================

[](#notification-editor-for-elgg)

[![Elgg 2.0](https://camo.githubusercontent.com/981b94044a74b931be93e2825c7151896de9c8a53ccb960daf01b8fe0d800774/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c67672d322e302e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/981b94044a74b931be93e2825c7151896de9c8a53ccb960daf01b8fe0d800774/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c67672d322e302e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)

Features
--------

[](#features)

- Editable HTML notification templates built with Mustache
- Flexible use of object and variables in templates
- An option to send intstant notification with custom templates

[![Interface](https://camo.githubusercontent.com/80f0e6968366347d5e8236104784cad24b1b1b30f33aa485522836c9ed5a71b7/68747470733a2f2f7261772e6769746875622e636f6d2f687970654a756e6374696f6e2f456c67672d6e6f74696669636174696f6e735f656469746f722f6d61737465722f73637265656e73686f74732f696e746572666163652e706e67 "Admin Interface")](https://camo.githubusercontent.com/80f0e6968366347d5e8236104784cad24b1b1b30f33aa485522836c9ed5a71b7/68747470733a2f2f7261772e6769746875622e636f6d2f687970654a756e6374696f6e2f456c67672d6e6f74696669636174696f6e735f656469746f722f6d61737465722f73637265656e73686f74732f696e746572666163652e706e67)

Subscription Notifications
--------------------------

[](#subscription-notifications)

The plugin will automatically hijack notifications for all registered notifications events (events that send out subscription notifications). The plugin will first try to locate a view that corresponds to the subject, summary and body of the notification, and use the template view, if it's found. Administrators have the ability to edit the templates, in which case a new template object is created and stored in the database.

Notification views are stored in: `/views/default/notifications/$action/$object_type/$object_subtype/$part.$language.html`, where `$action` is an action triggering the notification event, `$object_type` is `object`, `group`, `user`, `site`, `annotation` or `relationship``$object_subtype` is an entity subtype, or annotation name, or relationship name `$part` is either `subject`, `summary` or `body``$language` is the language of the recipient

Custom (Instant) Notifications
------------------------------

[](#custom-instant-notifications)

For this to work, your delivery method handlers need to trigger `'format','notification'` hook and pass the notification object as return. For email delivery method, enable *notifications\_html\_handler* plugin.

```
// enable templates for notifier
elgg_register_plugin_hook_handler('send', 'notification:notifier', 'notifier_notification_send');
function notifier_notification_send($hook, $type, $result, $params) {
	$notification = $params['notification'];
	$notification = elgg_trigger_plugin_hook('format', 'notification', $params, $notification);

	// continue with logic
}
```

You can send instant notifications using templates by passing a template name with the notification parameters:

```
notify_user($to, $from, '', '', array(
	'template' => 'my_template',
	'my_param' => $param,
));
```

You can then edit your templates, and reference your params as so:

```
// in notifications/my_template/body.en.html
This is my template with {{params.my_param}}!
```

To make templates editable by admin, register them:

```
elgg_register_plugin_hook_handler('get_templates', 'notifications', function($h, $t, $r) {
	$r[] = 'my_template';
	return $r;
}
```

Below you can see how to send a notification using a custom template.

Let's say we want to notify a user that their account has been created:

```
notify_user($recipient->guid, $site->guid, '', '', array(
	'template' => 'useradd',
	'actor' => elgg_get_logged_in_user_entity(),
	'password' => '123456789',
));
```

```
// in /views/default/notifications/useradd/body.en.html
Dear {{recipient.name}},

{{#actor}}
	{{actor.name}} has created an account for you at {{site.name}}.
{{/actor}}
{{^actor}}
	A use raccount has been created for you at {{site.name}}.
{{/actor}}

Your login credentials are as follows:

Username: {{recipient.username}}
Password: {{params.password}}

Once you have logged in, we highly recommend that you change your password.
You can do so in your account settings.

Login
```

Properties
----------

[](#properties)

Properties available in templates:

See [mustache reference](https://mustache.github.io/mustache.5.html) for information on ternaries and loops

#### Available in all notifications

[](#available-in-all-notifications)

```

		**{{sender.name}}**

		Name of the sender

		**{{sender.getURL}}**

		URL of the sender's profile

		**{{sender.XXX}}**

		Any metadata or method attached to the sender object (e.g. {{sender.language}})

		**{{recipient.name}}**

		Name of the recipient

		**{{recipient.getURL}}**

		URL of the recipients's profile

		**{{recipient.XXX}}**

		Any metadata or method attached to the recipient object (e.g. {{recipient.first_name}})

		**{{language}}**

		Language of the recipient

		**{{site.name}}**

		Name of the site

		**{{site.getURL}}**

		URL of the site (with the trailing slash)

		**{{params.XXX}}**

		Additional params passed to the notification object. The actual available values depend on the notification

```

#### Available in subscription notifications

[](#available-in-subscription-notifications)

```

		**{{action}}**

		Action name that triggered the subscription notification event

		**{{actor.name}}**

		Name of the actor (a user performing an action)

		**{{actor.getURL}}**

		URL of the actor's profile

		**{{actor.XXX}}**

		Any metadata or method attached to the actor object (e.g. {{actor.language}})

		**{{object.XXX}}**

		Depending on the event, an object is either an entity, or an annotation, or a relationship. Available properties may vary depending on that.

		**{{target.XXX}}**

		Target of the event: For events that involve Elgg entities, the target is the container entity, e.g. if object is a blog, the target is either a user or group For events that involve annotations, the target is an entity that that annotation is made on For events that involve relationships, the target is an object with subject and object properties, where subject represents the subject of the relationship and object represents the object of the relationship

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~309 days

Total

2

Last Release

3442d ago

Major Versions

1.0.0 → 2.x-dev2016-12-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/5071b1cd852e094b3f564962a625e04c227adc73af30c5b46b243ab8f20154a7?d=identicon)[hypeJunction](/maintainers/hypeJunction)

---

Top Contributors

[![hypeJunction](https://avatars.githubusercontent.com/u/1202761?v=4)](https://github.com/hypeJunction "hypeJunction (2 commits)")

---

Tags

pluginhtmlelggnotificationstemplates

### Embed Badge

![Health badge](/badges/hypejunction-notifications-editor/health.svg)

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

PHPackages © 2026

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