Plugin Template Creation
This guide is for plugin/theme developers who want their own prebuilt scenario templates to appear inside Notificator Companion.
What a template gives you
Section titled “What a template gives you”A template pre-fills scenario settings in the admin UI:
hook_namedescriptionscenario_name- optional
hook_meta - optional prefilled
conditions
Minimal registration example
Section titled “Minimal registration example”Add this in your plugin/theme bootstrap:
<?phpadd_action('notificator_companion_register_templates', function () { if (!function_exists('notificator_companion_register_template')) { return; }
notificator_companion_register_template(array( 'icon' => 'dashicons-admin-generic', 'title' => 'My Plugin: Something Happened', 'hook_name' => 'my_plugin_event', 'description' => 'Fires when my plugin event runs', 'scenario_name' => 'My Plugin Event', 'required_plugin' => 'my-plugin-slug', 'hook_meta' => array( 'label' => 'My plugin event', 'type' => 'action', 'arg_names' => array('user_id'), 'payload_arity' => 1, ), 'conditions' => array( array( 'field' => 'user_id', 'operator' => '>=', 'value' => '1', 'value_type' => 'number', 'value_label' => 'User ID at/above', 'value_placeholder' => '1', 'locked' => true, 'lock_field' => true, 'lock_operator' => true, ), ), ));});Make your custom slug visible
Section titled “Make your custom slug visible”If you use custom required_plugin, add your slug to active identifiers:
add_filter('notificator_companion_active_plugin_identifiers', function ($ids) { $ids[] = 'my-plugin-slug'; return $ids;});If you do not want custom slug handling, set:
required_plugin=>wordpress-core
Template fields reference
Section titled “Template fields reference”iconstring: Emoji or Dashicon class.titlestring: Card title in template picker.hook_namestring: Target hook.descriptionstring: Short explanation.scenario_namestring: Default scenario name.required_pluginstring: Filtering key.hook_metaarray: Hook metadata (arg_names,payload_arity, etc.).conditionsarray: Prefilled condition rules.
Verification checklist
Section titled “Verification checklist”- Activate your plugin and Notificator Companion.
- Open Notificator admin page.
- Open templates picker and confirm your template appears.
- Apply template and save scenario.
- Trigger the hook and verify notification arrives.