---
title: "FlashMessage finisher"
manual: "Form"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/typo3/cms-form:concepts-finishers-flashmessagefinisher@13.4"
source: "I/Concepts/Finishers/ReadyToUseFinishers/FlashMessageFinisher/Index.rst"
rendered: "2026-10-03T08:24:23+00:00"
---

# FlashMessage finisher {#concepts-finishers-flashmessagefinisher}

The "FlashMessage finisher" is a basic finisher that adds a message to the
FlashMessageContainer.

**Table of contents**

-   [Options of the FlashMessage finisher](https://docs.typo3.org/permalink/typo3/cms-form:options-of-the-flashmessage-finisher@13.4)
-   [FlashMessage finisher in the YAML form definition](https://docs.typo3.org/permalink/typo3/cms-form:flashmessage-finisher-in-the-yaml-form-definition@13.4)
-   [Usage of the FlashMessage finisher in PHP code](https://docs.typo3.org/permalink/typo3/cms-form:usage-of-the-flashmessage-finisher-in-php-code@13.4)

> [!NOTE]
> This finisher cannot be used from the backend editor. It can only be
> inserted directly into the YAML form definition or programmatically.

> [!IMPORTANT]
> Finishers are executed in the order defined in your form definition.
>
> See [Finisher execution order](https://docs.typo3.org/permalink/typo3/cms-form:concepts-finishers-execution-order@13.4).

## Options of the FlashMessage finisher {#apireference-finisheroptions-flashmessagefinisher-options}

The following options can be set directly in the form definition YAML or
programmatically in the options array:

-   **messageBody**

    -   *Type:* string
    -   *Required:* true

    The flash message to be displayed. May contain placeholders like `%s` that
    are replaced with the `messageArguments`.

-   **messageTitle**

    -   *Type:* string
    -   *Default:* `''`

    If set is displayed as the title of the flash message.

-   **messageArguments**

    -   *Type:* array
    -   *Default:* `[]`

    If the `messageBody` contains placeholders like `%s` they can be replaced
    with these arguments.

-   **messageCode**

    -   *Type:* ?int
    -   *Default:* `null`

    A unique code to make the message recognizable. By convention the current
    unix time stamp at the time of initially creating the message is used,
    for example `1758455932`.

-   **severity**

    -   *Type:* `\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity`
    -   *Default:* `ContextualFeedbackSeverity::OK`

    The severity influences the display (color and icon) of the flash message.

-   **translation.propertiesExcludedFromTranslation**

    -   *Type:* array
    -   *Default:* `[]`

    Defines a list of finisher option properties that should be excluded from
    translation.

    When specified, the listed properties are not processed by the
    `\TYPO3\CMS\Form\Service\TranslationService` during translation
    of finisher options. This prevents their values from being replaced by
    translated equivalents, even if translations exist for those options.

    This option is usually generated automatically as soon as FlexForm overrides
    are in place and normally does not need to be set manually in the form
    definition.

    See [Skip translation of overridden form finisher options](https://docs.typo3.org/permalink/typo3/cms-form:concepts-finishers-confirmationfinisher-yaml-propertiesexcludedfromtranslation@13.4)
    for an example.

## FlashMessage finisher in the YAML form definition {#concepts-finishers-flashmessagefinisher-yaml}

**public/fileadmin/forms/my_form.yaml**

```yaml
identifier: example-form
label: 'example'
type: Form

finishers:
  -
    identifier: FlashMessage
    options:
      messageTitle: 'Merci'
      messageCode: 201905041245
      messageBody: 'Thx for using %s'
      messageArguments:
        - 'TYPO3'
      severity: 0

```

## Usage of the FlashMessage finisher in PHP code {#apireference-finisheroptions-flashmessagefinisher}

Developers can create a confirmation finisher by using the key `FlashMessage`:

```php
<?php

use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity;
use TYPO3\CMS\Form\Domain\Model\FormDefinition;

class SomeClass
{
    private function addFlashMessageFinisher(FormDefinition $formDefinition, string $message)
    {
        $formDefinition->createFinisher('FlashMessage', [
            'messageTitle' => 'Merci',
            'messageCode' => 201905041245,
            'messageBody' => 'Thx for using %s',
            'messageArguments' => ['TYPO3'],
            'severity' => ContextualFeedbackSeverity::OK,
        ]);
    }
}

```

This finisher is implemented in `\TYPO3\CMS\Form\Domain\Finishers\FlashMessageFinisher`.
