---
title: "ApplyCustomSettingsToViewEvent"
manual: "LIA Form"
version: "2.2"
permalink: "https://docs.typo3.org/permalink/lia/lia_form:applycustomsettingstoviewevent@2.2"
source: "Events/ApplyCustomSettingsToViewEvent.rst"
rendered: "2026-09-29T13:27:41+00:00"
---

# ApplyCustomSettingsToViewEvent {#applycustomsettingstoviewevent}

Allows you to add your own settings to the view.

## Attributes {#attributes}

-   **emailView**

    -   *Type:* TYPO3CMSCoreMailFluidEmail
    -   *Required:* true

    This is the view which can be extended with your custom settings.

## Subscribe this event {#subscribe-this-event}

First create an EventListener class in your Extension. It may look like this.

**EXT:my_extension/Classes/EventListener/ApplyCustomSettingsToViewEventListener.php**

```php
<?php
declare(strict_types=1);

namespace MY\MyExtension\EventListener;

use LIA\LiaForm\Event\ApplyCustomSettingsToViewEvent;

final class ApplyCustomSettingsToViewEventListener {

    /**
    * Manipulate the form configuration by a custom logic.
    *
    * @param ApplyCustomSettingsToViewEvent $event
    * @return void
    */
    public function __invoke(ApplyCustomSettingsToViewEvent $event): void
    {
        // The view is an object, so assigning to it is enough. Call
        // setEmailView() only to swap in a different FluidEmail instance.
        $event->getEmailView()->assign('myCustomVariable', 'someValue');
    }
}
```

Now register this EventListener in your `Services.yaml`.

**EXT:my_extension/Configuration/Services.yaml**

```yaml
MY\MyExtension\EventListener\ApplyCustomSettingsToViewEventListener:
  tags:
    - name: event.listener
      identifier: 'my-extension/apply-custom-settings-to-view-event'
      event: LIA\LiaForm\Event\ApplyCustomSettingsToViewEvent
```
