Project

General

Profile

Actions

Bug #96788

closed

"Test Mail Setup" cannot send mails if HTML mail template uses <f:format.html>

Added by Felix Heller over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2022-02-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:

Description

In TYPO3 11.5.6, it's not possible to send a mail in the "Test Mail Setup" (backend module "Environment" or install tool) if the mail HTML template uses the Fluid ViewHelper f:format.html. The following error occurs:

Could not deliver mail
Please verify $GLOBALS['TYPO3_CONF_VARS']['MAIL'][*] settings are valid. Error message: No valid attribute "applicationType" found in request object.

This worked well in TYPO3 10.4. Without the usage of the Fluid HTML ViewHelper or with the default mail template, the test mail is sent correctly in TYPO3 11.5, too.

Steps to reproduce the error:

  • In the LocalConfiguration.php, add an additional template root path:
    'MAIL' => [
        // ... other configuration options ...
        'templateRootPaths' => [
            20 => 'EXT:example/Resources/Private/Templates/Email/',
        ],
  • Create a HTML template file EXT:example/Resources/Private/Templates/Email/Default.html:
    <f:layout name="SystemEmail" />
    <f:section name="Main">
        {content -> f:format.html()}
    </f:section>
  • Try to send a test mail in the install tool or the TYPO3 backend by using the "Test Mail Setup".

The error is thrown in the class \TYPO3\CMS\Core\Http\ApplicationType in the method fromRequest(ServerRequestInterface $request).
It is called in \TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper:

public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
    $parseFuncTSPath = $arguments['parseFuncTSPath'];
    $isBackendRequest = ApplicationType::fromRequest($renderingContext->getRequest())->isBackend();

The request of the Fluid rendering context doesn't have an application type attribute set.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #94497: Avoid access of global request in view helpers ClosedOliver Bartsch2021-07-06

Actions
Actions

Also available in: Atom PDF