1. Go to this page and download the library: Download knocklabs/knock-php 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/ */
knocklabs / knock-php example snippets
use Knock\KnockSdk\Client;
$client = new Client('sk_12345');
$client->workflows()->trigger('dinosaurs-loose', [
// user id of who performed the action
'actor' => 'dnedry',
// list of user ids for who should receive the notification
'recipients' => ['jhammond', 'agrant', 'imalcolm', 'esattler'],
// data payload to send through
'data' => [
'type' => 'trex',
'priority' => 1,
],
// an optional identifier for the tenant that the notifications belong to
'tenant' => 'jurassic-park',
// an optional key to provide to cancel a notify
'cancellation_key' => '21e958bb-2517-40bb-aaaa-d40acc26dac3',
]);