Hey, get ready to be confused @frissdiegurke -- there's a third type of hook, rounding out the behaviours
action hooks are, as @Mega describes, fired when something happens, and NodeBB doesn't care about the response.
filters are fired when plugins might change things. The majority of hooks in NodeBB are filters.
static hooks are fired when you need NodeBB to wait until your plugin is complete in order to do something. There is only one static hook available right now: static:app.load, which is fired on startup.
In this case, since the post is already slated to be deleted, but you want to do something before it is deleted... we may want to consider adding a new hook called static:post.purge.
@jw-sbat Always make sure the plugins you are using are working fine before deploying to production. Even if the plugin doesn't specify compatibility directly it could still work. That property specifies a minimum nodebb version.
@Enrique the main problem you seem to be having is that you are not aware that there is a frontend and a backend to NodeBB. You have to wire up the controls from the ACP and make a call to the backend (via websocket, for example), and then you can call server side libraries.
Your don't need the header in your template. You need to add it like this:
router.get('/calendar', middleware.buildHeader, renderPageHandler);