PHP code example of errnesto / kirby-plugin-webhooks

1. Go to this page and download the library: Download errnesto/kirby-plugin-webhooks library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

errnesto / kirby-plugin-webhooks example snippets


// default:
return [
  'errnesto.webhooks.getURL' => function ($trigger, $webhook, ...$params) {
    return $webhook['url'];
  }
];

return [
  // default:
  'errnesto.webhooks.getHeader' => function ($trigger, $webhook, ...$params) {
    return "Content-type: application/json\r\n";
  }
];

return [
  // default:
  'errnesto.webhooks.getMethod' => function ($trigger, $webhook, ...$params) {
    return "POST";
  }
];

return [
  // default
  'errnesto.webhooks.getPayload' => function ($trigger, $webhook, ...$params) {
    return $webhook['payload'];
  },
];