Hooks
Hooks
klub.signup ($user)
klub.member.created ($user)
klub.license.checked ($members, $maxMembers)
klub.license.failed ($members, $maxMembers, $msg)
klub.payment:before ($user, $session, $data)
klub.payment:after ($user, $session, $data)
klub.subscribe:before ($user, $session, $data)
klub.subscribe:after ($user, $session, $data)
klub.change:before ($user, $subscriptionId, $priceId, $data)
klub.change:after ($user, $subscription, $data)
klub.renew:before ($user, $subscriptionId, $data)
klub.renew:after ($user, $subscriptio, $data)
klub.cancel:before $user, $subscriptionId, $data)
klub.cancel:after ($user, $subscription, $data)
klub.progress.add ($user)
klub.progress.remove ($user)
$user
is an instance of a Kirby User.$session
is an array with the session data from payment gateway.$data
is the array of the the HTML form data that initialized the event.
Fatal Errors
You can use Kirby's fatal
-option callback (see docs) to get notified about errors happening. Please note that you will need to provide a custom template as well.
site/config/config.php
return [
'fatal' => function($kirby, $exception) {
site()->discord(['content' => $exception->getMessage()]);
// or send a mail/sms
include $kirby->root('templates') . '/fatal.php';
}
];