#111023FluidEmail with the default layout crashes without normalizedParams in the request
Description
Since TYPO3 v14, sending a FluidEmail with the default SystemEmail
layout fails when the request has no normalizedParams attribute. This
is the typical case in a CLI command or a scheduler task:
DefaultSystemResourcePublisher::getFrontendUrlPrefix(): Argument #2
($normalizedParams) must be of type NormalizedParams, null given
Affected versions: 14.3 and main. Reproduced on 14.3.7. The same code
works in 13.4.
Steps to reproduce
1. In a command, create a request:
new ServerRequest($site->getBase()) with the attributes
applicationType (REQUESTTYPE_FE) and site.
2. Create the mail with TemplatedEmailFactory::create($request) and
send it with the default template.
Cause
FluidEmail::setRequest() puts the request into the rendering context.
When the request has no normalizedParams, it creates a fallback from
$_SERVER, but only assigns it as the view variable “normalizedParams”.
The request in the rendering context stays without the attribute.
The layout renders the logo with f:uri.resource. Since the System
Resource API (#107537), this ViewHelper calls
DefaultSystemResourcePublisher with the request from the rendering
context. extractPublicPrefixFromRequest() reads normalizedParams from
the request and passes null to getFrontendUrlPrefix(), which requires
NormalizedParams.
In 13.4, f:uri.resource used PathUtility::getAbsoluteWebPath() and did
not need the request.
TemplatedEmailFactory::create() documents itself for backend and CLI
contexts, and passes the request to setRequest() unchanged.
Workaround
Add the attribute before creating the mail:
$request->withAttribute(‘normalizedParams’,
NormalizedParams::createFromRequest($request))
Possible solution
Put the fallback on the request too, for example with
withAttribute(‘normalizedParams’, …), before setRequest() hands the
request to the rendering context.
Found while documenting how to send FluidEmail from a command:
https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/7229
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 3
-
Lina Wolf changed description <span data-processor="relativetime" data-value="2026-10-11T16:48:04+00:00" > 10/11/26, 16:48 </span>
-
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2026-10-18T16:02:06+00:00" > 10/18/26, 16:02 </span> -
Georg Ringer commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-11-20T20:48:33+00:00" > 11/20/26, 20:48 </span>hey!
to cleanup forge, I am closing this issue. if still valid for you, feel free to reopen the issue or create a new one and provide the required information.
thanks!
Hey Lina,
when you create the request manually on CLI anyways, can’t you create the normalizedParams there as well? You do this with applicationType already anyways?