fluentform_submission_confirmation

Description  #

This filter is available just before sending the success message to the user. You can use this filter hook to alter form confirmation message, redirect settings dynamically.

apply_filters('fluentform_submission_confirmation', $returnData, $form, $confirmation );

Usage   #

The following would apply to all forms:

add_filter('fluentform_submission_confirmation', 'custom_code_before_confirmation_msg_function', 10, 3);

function custom_code_before_confirmation_msg_function($returnData, $form, $confirmation )
{
   // Do your stuffs here
   return $returnData;
}

The following would apply to a specific form id 5:

add_filter('fluentform_submission_confirmation', 'custom_code_before_confirmation_msg_function', 10, 3);

function custom_code_before_confirmation_msg_function($returnData, $form, $confirmation )
{
   if($form->id!= 5) {
      return $returnData;
   }

   // Do your stuffs here 
   return $returnData;
}

Parameters  #

  • $returnData (array)

This parameter will have different values based on your confirmation settings, please check the file  app/Modules/Form/FormHandler.php for details understanding.

$returnData = [
  
    'message'     => 'Redirecting message'
    'action'      => 'hide_form'
    'redirectTo'  => customUrl
    'redirectUrl' => http://google.com

];
$confirmation = [
    'redirectTo'           => 'samePage'  // or customUrl or customPage
    'messageToShow'        => 'Thank you for your message. We will get in touch with you shortly'
    'customPage'           => '' 
    'samePageFormBehavior' => 'hide_form' // or reset_form 
    'customUrl'            => 'https://yourcustomurl.com'
];

Placement #

This code should be placed in the functions.php file of your active theme.

Source Code #

This filter is located in FluentForm\App\Modules\Form -> getReturnData() in app/Modules/Form/FormHandler.php

Powered by BetterDocs