1. Home
  2. Docs
  3. Poptics Documentation
  4. General Settings
  5. Submission Hook for Poptics

Submission Hook for Poptics

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:

KeyTypeDescription
campaign_idintID of the campaign the submission belongs to.
emailstringSubmitter’s email address.
browserstringThe browser used for the submission.
locationstringCountry name of the submitter.
devicestringDevice type (desktop/tablet/mobile).
other_detailsarrayAdditional 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

How can we help?