Hi there,
i installed the new Commention plugin and it works fine so far, apart from one problem:
I can’t get the email hook get to work. When i copy this into my config file:
'hooks' => [
'commentions.add:after' => function ( $page, $data ) {
try {
$kirby->email([
'from' => 'webserver@example.com',
'to' => 'admin@example.com',
'subject' => 'New comment/webmention on ' . $page->title(),
'body'=> print_r($data, true),
]);
} catch (Exception $error) {
echo $error;
}
}
],
i get the error message: Call to a member function email() on null
I checked if php email works, and with the kirby contact form it works fine (with a controller & template setup).
I don’t understand the problem, did anyone else had it yet?