Download the PHP package hypejunction/notifications_editor without Composer
On this page you can find all versions of the php package hypejunction/notifications_editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hypejunction/notifications_editor
More information about hypejunction/notifications_editor
Files in hypejunction/notifications_editor
Package notifications_editor
Short Description Notification Editor for Elgg
License GPL-2.0
Homepage http://hypejunction.com
Informations about the package notifications_editor
Notification Editor for Elgg
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
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
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.
You can send instant notifications using templates by passing a template name with the notification parameters:
You can then edit your templates, and reference your params as so:
To make templates editable by admin, register them:
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:
Properties
Properties available in templates:
See mustache reference for information on ternaries and loops
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
**{{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 |
All versions of notifications_editor with dependencies
composer/installers Version 1.*
hypejunction/mustache Version ~1.0
hypejunction/forms_api Version ~1.0