---
title: fluentform/submission_confirmation
description: "## Description  This filter is available just before sending the success message to the user. You can use this filter hook to alter the form confirmation message and redirect settings dynamically. ```php apply_filters('fluentform/submission_confirmation', $returnData, $form, $confirmation, $insertId, $formData); ``` ##…"
url: "https://fluentforms.com/docs/fluentform_submission_confirmation/"
updated: "2025-03-10"
category: Filter Hooks
tags:
  - Submission Filter
---

# 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 the form confirmation message and redirect settings dynamically.

```php
apply_filters('fluentform/submission_confirmation', $returnData, $form, $confirmation, $insertId, $formData);
```

## Usage  

The following would apply to all forms:

```php
add_filter('fluentform/submission_confirmation', 'custom_code_before_confirmation_msg_function', 10, 5);

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

The following would apply to a specific form ID 5:

```php
add_filter('fluentform/submission_confirmation', 'custom_code_before_confirmation_msg_function', 10, 5);

function custom_code_before_confirmation_msg_function($returnData, $form, $confirmation, $insertId, $formData)
{
   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 *FluentForm\App\Http\Controllers\SubmissionHandlerController* for better understanding.

```php
$returnData = [

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

];
```

- **$form** (Object) The [$form Object](https://fluentforms.com/docs/form-object/)
- **$confirmation** (array)

```php
$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'
];
```

- **$insertId** (int) Submission ID
- **$formData** (array) Submission Data

## Placement

This code should be placed in the [functions.php](http://codex.wordpress.org/Theme_Development#Functions_File) file of your active theme.

## Source Code

This filter is located in FluentForm\app\Services\Form\SubmissionHandlerService -> getReturnData($insertId, $form, $formData)
