PHP code example of hypejunction / notifications_editor

1. Go to this page and download the library: Download hypejunction/notifications_editor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hypejunction / notifications_editor example snippets


// 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
}

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

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

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