Skip to content

Sennik/statamic-form-webhooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Statamic Form Webhooks

Send Statamic form submissions to external webhooks (Zoho Flow, Make, Zapier, etc.).

Installation

composer require sennik/statamic-form-webhooks

Publish the config file:

php artisan vendor:publish --tag=form-webhooks-config

Configuration

Edit config/form-webhooks.php:

'webhooks' => [
    'contact' => [
        'url'    => env('WEBHOOK_CONTACT_URL'),
        'fields' => '*', // all fields
    ],
    'offerte' => [
        'url'    => env('WEBHOOK_OFFERTE_URL'),
        'fields' => ['naam', 'email', 'telefoon'], // specific fields only
    ],
],

Add the webhook URLs to your .env:

WEBHOOK_CONTACT_URL=https://example.com/webhook/contact
WEBHOOK_OFFERTE_URL=https://example.com/webhook/offerte

Options

Key Type Description
url string The webhook endpoint (POST)
fields string|array '*' to send all fields, or an array of field handles to send

How it works

  1. A visitor submits a Statamic form
  2. The FormSubmitted event fires
  3. The listener checks if a webhook is configured for that form handle
  4. If so, the submission data is POST'ed to the webhook URL
  5. Errors are logged but never interrupt the form submission

Requirements

  • PHP 8.2+
  • Statamic 5.x or 6.x

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages