diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-92435-DeprecatedStandaloneViewForEmailFinisher.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-92435-DeprecatedStandaloneViewForEmailFinisher.rst new file mode 100644 index 0000000000000000000000000000000000000000..8f71916ed35093bd6caa63a9ad0c7d57f0622a0e --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-92435-DeprecatedStandaloneViewForEmailFinisher.rst @@ -0,0 +1,80 @@ +.. include:: ../../Includes.txt + +================================================================= +Deprecation: #92435 - Deprecated StandaloneView for EmailFinisher +================================================================= + +See :issue:`92435` + +Description +=========== + +The :php:`EmailFinisher` of EXT:form was extended for the possibility to use +FluidEmail in TYPO3 10. Therefore the previously used StandaloneView has now been +deprecated along with the configuration option :yaml:`templatePathAndFilename`. + + +Impact +====== + +Using the StandaloneView will trigger a deprecation log warning. Using +:yaml:`templatePathAndFilename` for custom templates will also trigger a +deprecation log warning. + + +Affected Installations +====================== + +All installations not already using FluidEmail for the EXT:form EmailFinisher. + + +Migration +========= + +Adjust your finisher configuration to use FluidEmail by setting :yaml:`useFluidEmail: true`. + +Before: + +.. code-block:: yaml + + finishers: + - + identifier: EmailToReceiver + options: + useFluidEmail: false + +After: + +.. code-block:: yaml + + finishers: + - + identifier: EmailToReceiver + options: + useFluidEmail: true + +For custom templates, replace :yaml:`templatePathAndFilename` with :yaml:`templateName` +and :yaml:`templateRootPaths`. + +Before: + +.. code-block:: yaml + + finishersDefinition: + EmailToReceiver: + options: + templatePathAndFilename: EXT:sitepackage/Resources/Private/Templates/Email/ContactForm.html + +After: + +.. code-block:: yaml + + finishersDefinition: + EmailToReceiver: + options: + templateName: ContactForm + templateRootPaths: + 100: 'EXT:sitepackage/Resources/Private/Templates/Email/' + + +.. index:: YAML, NotScanned, ext:form diff --git a/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php b/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php index 1e0d81683605158eb663383bae7e9f4c7be2e683..3032283f671b8e06688abb3d2354cece98ef6645 100644 --- a/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php +++ b/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php @@ -198,12 +198,23 @@ class EmailFinisher extends AbstractFinisher * @param string $format * @return StandaloneView * @throws FinisherException + * @deprecated since v11, will be removed in v12 */ protected function initializeStandaloneView(FormRuntime $formRuntime, string $format): StandaloneView { + trigger_error( + 'Using StandaloneView for EmailFinisher \'' . $this->finisherIdentifier . '\' is deprecated and will be removed in v12. Please use FluidEmail in the finishers configuration instead.', + E_USER_DEPRECATED + ); + $standaloneView = GeneralUtility::makeInstance(StandaloneView::class); if (isset($this->options['templatePathAndFilename'])) { + trigger_error( + 'The option \'templatePathAndFilename\' for EmailFinisher \'' . $this->finisherIdentifier . '\' is deprecated and will be removed in v12. Please use \'templateName\' and \'templateRootPaths\' in the finishers definition instead.', + E_USER_DEPRECATED + ); + $this->options['templatePathAndFilename'] = strtr($this->options['templatePathAndFilename'], [ '{@format}' => $format ]);