# Other events

## Bookmarks

The following events are dispatched when adding content items to bookmarks.

| Event                       | Dispatched by                     | Properties           |
| --------------------------- | --------------------------------- | -------------------- |
| `BeforeCreateBookmarkEvent` | `BookmarkService::createBookmark` | `Location $location` |
| `CreateBookmarkEvent`       | `BookmarkService::createBookmark` | `Location $location` |
| `BeforeDeleteBookmarkEvent` | `BookmarkService::deleteBookmark` | `Location $location` |
| `DeleteBookmarkEvent`       | `BookmarkService::deleteBookmark` | `Location $location` |

## Notifications

The following events refer to [notifications displayed in the user menu](https://doc.ibexa.co/en/latest/administration/back_office/notifications/#create-custom-notifications).

| Event                                                                                                                                                                                                      | Dispatched by                                                                                                                                                                                                    | Properties                                                     |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [`BeforeCreateNotificationEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-BeforeCreateNotificationEvent.html)             | [`NotificationService::createNotification`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_createNotification)             | \`CreateStruct $createStruct\`\`Notification                   |
| [`CreateNotificationEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-CreateNotificationEvent.html)                         | [`NotificationService::createNotification`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_createNotification)             | ``` Notification $notification``CreateStruct $createStruct ``` |
| [`BeforeDeleteNotificationEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-BeforeDeleteNotificationEvent.html)             | [`NotificationService::deleteNotification`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_deleteNotification)             | `Notification $notification`                                   |
| [`DeleteNotificationEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-DeleteNotificationEvent.html)                         | [`NotificationService::deleteNotification`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_deleteNotification)             | `Notification $notification`                                   |
| [`BeforeMarkNotificationAsReadEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-BeforeMarkNotificationAsReadEvent.html)     | [`NotificationService::markNotificationAsRead`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_markNotificationAsRead)     | `Notification $notification`                                   |
| [`MarkNotificationAsReadEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-MarkNotificationAsReadEvent.html)                 | [`NotificationService::markNotificationAsRead`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_markNotificationAsRead)     | `Notification $notification`                                   |
| [`BeforeMarkNotificationAsUnreadEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-BeforeMarkNotificationAsUnreadEvent.html) | [`NotificationService::markNotificationAsUnread`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_markNotificationAsUnread) | `Notification $notification`                                   |
| [`MarkNotificationAsUnreadEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Events-Notification-MarkNotificationAsUnreadEvent.html)             | [`NotificationService::markNotificationAsUnread`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-NotificationService.html#method_markNotificationAsUnread) | `Notification $notification`                                   |

## Settings

The following events refer to key/value application-wide settings in database.

| Event                      | Dispatched by                   | Properties                                                                                  |
| -------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------- |
| `BeforeCreateSettingEvent` | `SettingService::createSetting` | \`SettingCreateStruct $settingCreateStruct\`\`Setting                                       |
| `CreateSettingEvent`       | `SettingService::createSetting` | ``` Setting $setting``SettingCreateStruct $settingCreateStruct ```                          |
| `BeforeUpdateSettingEvent` | `SettingService::updateSetting` | \`Setting $setting`SettingUpdateStruct $settingUpdateStruct`Setting                         |
| `UpdateSettingEvent`       | `SettingService::updateSetting` | ``` Setting $updatedSetting``Setting $setting``SettingUpdateStruct $settingUpdateStruct ``` |
| `BeforeDeleteSettingEvent` | `SettingService::deleteSetting` | `Setting $setting`                                                                          |
| `DeleteSettingEvent`       | `SettingService::deleteSetting` | `Setting $setting`                                                                          |

## User preferences

The following events are dispatched when changing the user settings available in the user menu.

| Event                          | Dispatched by                              | Properties                                            |
| ------------------------------ | ------------------------------------------ | ----------------------------------------------------- |
| `BeforeSetUserPreferenceEvent` | `UserPreferenceService::setUserPreference` | `UserPreferenceSetStruct[] $userPreferenceSetStructs` |
| `SetUserPreferenceEvent`       | `UserPreferenceService::setUserPreference` | `UserPreferenceSetStruct[] $userPreferenceSetStructs` |

## DAM assets

| Event                 | Dispatched by                                        | Properties                                                                                                       |
| --------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `PublishVersionEvent` | `PublishAssetEventDispatcher::emitPublishAssetEvent` | ``` Content $content``Connector\Dam\AssetIdentifier $assetIdentifier``Connector\Dam\AssetSource $assetSource ``` |

## Image Editor

The following event is dispatched when the Image Editor optimizes an image. You can subscribe to it to customize the list of active image optimizers at runtime.

For more information, see [Customizing image optimizers with an event](https://doc.ibexa.co/en/latest/content_management/images/images/#customizing-image-optimizers).

| Event                                                                                                                                                                        | Dispatched by                       | Properties                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | ---------------------------------------------------- |
| [`ConfigureImageOptimizersEvent`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-ImageEditor-Event-ConfigureImageOptimizersEvent.html) | `SpatieChainOptimizer::` `optimize` | `array<Spatie\ImageOptimizer\Optimizer> $optimizers` |

## Form Builder (Experience) (Commerce)

| Event                           | Dispatched by                                      | Properties                                                                                                            |
| ------------------------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `FieldAttributeDefinitionEvent` | `FieldDefinitionFactory::getAttributesDefinitions` | ``` FieldAttributeDefinitionBuilder $definitionBuilder``array $configuration ```                                      |
| `FieldDefinitionEvent`          | `FieldDefinitionFactory::getFieldDefinition`       | ``` FieldDefinitionBuilder $definitionBuilder``array $configuration ```                                               |
| `FieldValidatorDefinitionEvent` | `FieldDefinitionFactory::getValidatorsDefinitions` | ``` FieldDefinitionBuilder $definitionBuilder``array $configuration ```                                               |
| `FormActionEvent`               | `HandleFormSubmission::handleFormSubmission`       | ``` ContentView $contentView``Ibexa\Contracts\FormBuilder\FieldType\Model\Form $form``string $action``mixed $data ``` |
| `FormSubmitEvent`               | `HandleFormSubmission::handleFormSubmission`       | ``` ContentView $contentView``Ibexa\Contracts\FormBuilder\FieldType\Model\Form $form``array $data ```                 |
