"Notify about something", 'function' => "customNotify", 'category' => '' ); return $config; } function customNotify($data) { $subject = "My Notification"; $message = print_a($data,true); $this->send('customNotify', $subject, $message); } // BELOW IS OPTIONAL - R IF YOU WISH YOUR PLUGIN TO BECOME A ROUTER OF NOTIFICATIONS. eg. sending sms or messages to other platforms. /** * REMOVE THIS METHOD WHEN NOT IN USE. * @return array */ function router() { $ret = []; $ret['other_type'] = array( // 'other_type' method will be called when this notification is triggered (see method below) 'label' => "Blank Example", // label used in admin Notify area 'field' => "handle", // rendered in the admin Notify area when this option is selected. see method below. 'category' => '' ); return $ret; } /** * Custom method used to render a field in Admin Notify area. * REMOVE THIS METHOD WHEN NOT IN USE. * @param string $name Field name. * @param mixed $curVal current value. * @return string */ function handle($name, $curVal) { return e107::getForm()->text($name, $curVal, 80, ['size'=>'large','placeholder'=>'eg. account name']); } /** * Custom Method to handle notification. * REMOVE THIS METHOD WHEN NOT IN USE * @param array $data * @return array */ function other_type($data) { return $data; // Peform some other kind of notification and return true on success / false on error. } }