Hooks

Actions

psn_after_load_services

The action psn_after_load_services applies after PSN’s built-in notification services got loaded. Use it to load your own notification service. For more details see Adding a notification service.

Parameter(s)

  1. object Psn_Notification_Manager $notificationManager

Example

<?php
add_action('psn_after_load_services', 'addNotificationService');

function addNotificationService(Psn_Notification_Manager $notificationManager) {
    $notificationManager->addService( new Psn_Module_Example_Service_MyService() );
}

psn_notification_placeholders_loaded

The action psn_notification_placeholders_loaded applies after PSN’s built-in placeholders got loaded. Use it to add your custom placeholders.

Parameter(s)

  1. object Psn_Notification_Placeholders $placeholders

Example

<?php
add_action('psn_notification_placeholders_loaded', 'addPlaceholders');

function addPlaceholders(Psn_Notification_Placeholders $placeholders) {
    $placeholders->addPlaceholder('my_awesome_placeholder', 'with_awesome_content');
}

Filters

psn_rule_notification_subject

The filter psn_rule_notification_subject applies on the subject of the matching notification rule.

Parameter(s)

  1. string $subject

  2. object Psn_Model_Rule $rule

<?php
add_filter('psn_rule_notification_subject', 'filterSubject', 10, 2);

function filterSubject($subject, Psn_Model_Rule $rule) {
    $subject = strtoupper($subject);
    return $subject;
}

psn_rule_notification_body

The filter psn_rule_notification_body applies on the body text of the matching notification rule.

Parameter(s)

  1. string $body

  2. object Psn_Model_Rule $rule

<?php
add_filter('psn_rule_notification_body', 'filterBody', 10, 2);

function filterBody($body, Psn_Model_Rule $rule) {
    $body .= "\n\nAppend this to all notification texts.";
    return $body;
}