Hook Name: poptics_after_submission_create
Action Hook
This action fires immediately after the Poptics plugin successfully creates a new submission.
Developers can use this hook to trigger automations, send notifications, or sync data to external systems whenever a new submission occurs.
Usage
add_action( 'poptics_after_submission_create', 'your_callback_function', 10, 1 );
function your_callback_function( $data ) {
// Your custom logic here.
}
Parameters
$data (array) — An associative array containing sanitized submission details:
| Key | Type | Description |
|---|---|---|
campaign_id | int | ID of the campaign the submission belongs to. |
email | string | Submitter’s email address. |
browser | string | The browser used for the submission. |
location | string | Country name of the submitter. |
device | string | Device type (desktop/tablet/mobile). |
other_details | array | Additional sanitized submission fields. |
Example
add_action( 'poptics_after_submission_create', 'send_custom_webhook_on_submission', 10, 1 );
function send_custom_webhook_on_submission( $data ) {
$webhook_url = 'https://example.com/webhook';
wp_remote_post( $webhook_url, [
'body' => wp_json_encode( $data ),
'headers' => [
'Content-Type' => 'application/json',
],
] );
}
When to Use
Use this hook when you want to:
- Send custom email notifications after a submission is made
- Sync submission data with CRMs (FluentCRM, ActiveCampaign, HubSpot, etc.)
- Trigger automations or third-party workflows
- Log or store submission data in external databases
- Integrate with marketing or analytics systems