Download the PHP package kreatif/statamic-forms without Composer
On this page you can find all versions of the php package kreatif/statamic-forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package statamic-forms
Kreatif Forms for Statamic
An configuration-driven addon for Statamic v5+ form submissions. Orchestrate complex post-submission workflows including emails, Iubenda consent tracking, and custom integrations—all from a central configuration file with priority-based execution, conditional logic, queue support, and comprehensive error handling.
Key Features
Core Architecture
- Action-Based System: Trigger multiple actions for each form submission with priority-based execution
- Centralized Configuration: Manage all form logic from a single configuration file
- Config Merging: Seamlessly combines global, handler-specific, and form-specific (YAML) configurations
- Interface-Driven: All actions implement
FormActionInterfacefor consistency and extensibility - Error Handling: Comprehensive try-catch blocks with detailed logging and graceful degradation
- Event System: Extensible events for
FormProcessingStarted,FormProcessingCompleted,ActionExecuted, andActionFailed
Email Management
- Statamic Email Control: Optionally disable Statamic's default email sending (configurable globally or per-form)
- Admin Notifications: Send detailed submission notifications to administrators
- Autoresponders: Send confirmation emails to form submitters
- Multiple Template Formats: Support for HTML, Markdown, and plain text templates
- Multiple Recipients: Configure
to,cc,bcc, andreplyToaddresses - Dynamic Branding: Configurable logos and organization names per form
- Content Sanitization: Built-in XSS protection for email content
- Multilingual Support: Full translation support for subjects and content
Advanced Features
- Queue Support: Queue any action for asynchronous execution with configurable connections, queues, and delays
- Conditional Execution: Execute actions based on submission data with powerful operators (equals, contains, in, empty, etc.)
- Priority Control: Define execution order with priority values (lower numbers run first)
- Rate Limiting: Prevent spam with configurable rate limits by IP, email, or session
- Validation: Built-in configuration validation for all actions
- Action Results: Structured result objects with success/failure states, data, and error messages
Built-in Actions
- SendAdminNotificationAction: Email notifications to administrators (Priority: 50)
- SendAutoresponderAction: Confirmation emails to users (Priority: 60)
- AddToIubendaAction: Send consent to Iubenda Consent Database (Priority: 90)
Installation & Setup
- Copy Addon: Place the entire kreatif/statamic-forms directory into your project's addons/ folder.
- Autoload: Run composer dump-autoload from your project's root directory to make Statamic aware of the addon's classes.
- Publish Assets: Publish the configuration file. This is the only mandatory step. Publishing views and language files is optional for customization.
- Configure Environment: Add the necessary API keys and URLs to your project's .env file.
Configuration
All addon logic is controlled via the config/kreatif-statamic-forms.php file.
Global Settings
Disable Statamic's Default Email
By default, Statamic will send its own emails based on the form's YAML configuration. You can disable this globally or per-form:
Logging Configuration
Control how the addon logs form processing:
Email Settings
These settings act as the default for all form handlers:
Form Handlers
This is the core of the addon. Each key in the handlers array corresponds to a Statamic form handle.
Action Configuration Options
All actions support these common configuration options:
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
bool | true |
Enable or disable the action |
priority |
int | Action-specific | Execution priority (lower runs first) |
queue |
bool | false |
Queue the action for async execution |
queue_connection |
string | default |
Laravel queue connection to use |
queue_name |
string | default |
Queue name |
delay |
int | 0 |
Delay in seconds before queueing |
when |
array | null |
Conditional execution based on submission data |
Queue Example
Queue an action for asynchronous processing:
Conditional Execution
Execute actions only when certain conditions are met:
Supported Operators:
=,==,equals- Equal to!=,not_equals- Not equal to===,strict_equals- Strictly equal to!==,strict_not_equals- Strictly not equal to>,greater_than- Greater than>=,greater_than_or_equal- Greater than or equal to<,less_than- Less than<=,less_than_or_equal- Less than or equal tocontains- String contains valuenot_contains- String does not contain valuein- Value is in arraynot_in- Value is not in arrayempty- Field is emptynot_empty- Field is not empty
Priority Control
Actions execute in priority order (lower numbers first). Default priorities:
- SendAdminNotificationAction: 50
- SendAutoresponderAction: 60
- AddToIubendaAction: 90
Override the priority:
Rate Limiting
Prevent spam submissions with rate limiting:
Available Actions
SendAdminNotificationAction Sends a detailed notification email to administrators.
Configuration:
SendAutoresponderAction sends a confirmation email to the user who submitted the form.
AddToIubendaAction Sends consent data to the Iubenda Consent Database.
Consent values can be fixed booleans (true/false), a form field handle ('newsletter' => 'newsletter'), or an explicit field config with a fallback ('marketing' => ['field' => 'marketing_consent', 'default' => false]). Submitted checkbox values like true, 1, yes, on, or any non-empty selected array are treated as consent given.
Advanced Mapping Tip: If your form only has a single name field, you can map it like this. The addon will automatically split it into a first and last name.
Usage Examples
Example 1: Standard Contact Form
Your addon config controls everything. The form's YAML is minimal.
config/kreatif-statamic-forms.php:
resources/forms/a_form.yaml:
Example 2: Overriding with Form YAML
The form's YAML configuration takes priority over the addon's action config. This is useful for client-managed forms.
config/kreatif-statamic-forms.php:
resources/forms/inquiries.yaml
Example 3: API-Only Form (Iubenda)
This setup uses the addon to send data to Iubenda but lets Statamic's default mailer handle the emails. This is achieved by not including the email actions in the handler.
config/kreatif-statamic-forms.php:
resources/forms/newsletter_signup.yaml:
Events System
The addon dispatches events throughout the form processing lifecycle. You can listen to these events to add custom logic:
Available Events
-
FormProcessingStarted- Dispatched when form processing begins- Properties:
Submission $submission,array $actions
- Properties:
-
FormProcessingCompleted- Dispatched when all actions have been executed- Properties:
Submission $submission,array $results
- Properties:
-
ActionExecuted- Dispatched when an action succeeds- Properties:
string $actionClass,Submission $submission,ActionResult $result
- Properties:
ActionFailed- Dispatched when an action fails- Properties:
string $actionClass,Submission $submission,ActionResult $result
- Properties:
Example: Listen to Events
Create a listener in your application:
Register in EventServiceProvider:
Creating Custom Actions
You can easily create custom actions by implementing FormActionInterface or extending BaseAction:
Then use it in your config:
Email Preview Feature
Preview and test email templates before sending them to actual recipients.
Access Preview
Navigate to Tools → Form Email Preview in the Statamic Control Panel, or click "Preview Email Templates" from any form's submissions listing.
Permissions: Requires view kreatif-forms email previews permission.
Features
- Preview Index: View all forms with email actions and their status
- Direct Preview: Preview admin notifications and autoresponders with sample data
- Template Editor: Interactive editor to customize sample data and preview both email types
- Multiple Formats: View HTML and plain text versions
Quick Preview URLs
Add ?format=text to any preview URL to see the plain text version.
How It Works
The preview controller automatically generates intelligent sample data based on your form's blueprint:
- Field types are detected and appropriate sample values are generated
- Smart pattern matching for common fields (name, email, company, etc.)
- Respects all configuration settings (logo, branding, excluded fields)
- Merges configs the same way live submissions do
How to Install
You can install this addon via Composer: