Download the PHP package errnesto/kirby-plugin-webhooks without Composer
On this page you can find all versions of the php package errnesto/kirby-plugin-webhooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download errnesto/kirby-plugin-webhooks
More information about errnesto/kirby-plugin-webhooks
Files in errnesto/kirby-plugin-webhooks
Package kirby-plugin-webhooks
Short Description Kirby plugin to register custom webhooks based on kirby hooks
License MIT
Informations about the package kirby-plugin-webhooks
Kirby Webhook Plugin
This is a simple plugin that lets you configure custom webhooks. Webhooks are trigged by kirby hook events.
Alternative:
https://github.com/pju-/kirby-webhook-field
Installation
Download
Download and copy this repository to /site/plugins/webhooks
.
Git submodule
Composer
Setup
This plugin looks for webhook configurations in the kirby site
object.
So to create a webhook you could just edit the content/site.txt
file:
The config must be stored under the key Webhooks
as yaml array.
Every webhook needs the following options:
url
: The URL to post to when a kirby hook is triggeredpayload
: The body of the post requesttriggers
: A comma seperated list of kirby hooks
A blueprint to edit the webhooks in the panel could look like this:
Options
You can customize the requests the plugin sends with your own functions.
Every function gets the following parameters:
$trigger
: The name of the hook that caused the webhook to be called$webhook
: The webhook read from the site object. (This will include any field you define)...$params
: All the params from the kirby hook.
You can set all of the following options by returning them in your /site/config/config.php
:
getURL()
getHeader()
getMethod()
getPayload()
TODO
- [ ] Add custom panel view and store webhooks somewhere else?
- [ ] Returning null from
getURL
should skip a hook and not cause an error - [ ] Option to make hook non blocking?
License
MIT