Connect your third party apps via Zapier or other third-party services to your TastyIgniter website.
Webhooks extension allows you to integrate your TastyIgniter site with external systems
It turns your site into a powerful optimized webhook system so that your site can communicate with your third party apps like Zapier.
For example:
In the admin user interface:
Example of Registering Webhook Events
Here is an example of an extension registering a webhook event to trigger an outgoing webhook.
public function registerWebhookEvents()
{
return [
'events' => [
'customer' => \IgniterLabs\Webhook\WebhookEvents\Customer::class,
],
];
}
Example of a Webhook Event Class
A webhook event class is responsible for preparing the parameters passed to the outgoing webhook.
class Customer extends \IgniterLabs\Webhook\WebhookEvents\BaseEvent
{
/**
* Returns information about this event, including name and description.
*/
public function eventDetails()
{
return [
'name' => 'Customers',
'description' => 'Customer created, updated or deleted.',
'setup' => '$/igniterlabs/webhook/webhookevents/customer/setup.md',
];
}
public static function registerEventListeners()
{
return [
'created' => 'eloquent.created: Admin\Models\Customers_model',
'updated' => 'eloquent.updated: Admin\Models\Customers_model',
'deleted' => 'eloquent.deleted: Admin\Models\Customers_model',
];
}
public static function makePayloadFromEvent(array $args, $actionCode = null)
{
$params = [];
$customer = array_get($args, 0);
if ($customer instanceof Customers_model)
$params['customer'] = $customer->toArray();
return $params;
}
}