Bug #93992
closedForms: html emails get sent with plaintext template when using {@format} wildcard in "templatePathAndFilename" and not setting "useFluidEmail"
100%
Description
In TYPO3 10LTS (current version 10.4.15) there is a bug in the ext "form" that causes html emails to be sent with the plaintext template.
General setup:
- useFluidEmail
: FALSE
- addHtmlPart
: TRUE
- templatePathAndFilename
: path set including {@format}
wildcard
Bug:
With this setup initializeStandaloneView()
gets called twice. Once for the plaintext part and once for the html part.
if (isset($this->options['templatePathAndFilename'])) {
$this->options['templatePathAndFilename'] = strtr($this->options['templatePathAndFilename'], [
'{@format}' => $format
]);
$standaloneView->setTemplatePathAndFilename($this->options['templatePathAndFilename']);
This code snippet from line 215 sets $this->options['templatePathAndFilename']
and overrides the {@format}
with Plaintext
. On the second run (html part) the wildcard is already replaced so the html email gets the same template like the plaintext email.
This is incorrect and a bug.
The error is introduced in 10LTS and was a regression from 9LTS since in 9LTS only a plaintext OR html email could be sent not both.
A simple fix would be:
if (isset($this->options['templatePathAndFilename'])) {
$templatePathAndFilename = strtr($this->options['templatePathAndFilename'], [
'{@format}' => $format,
]);
$standaloneView->setTemplatePathAndFilename($templatePathAndFilename);
}
Updated by Denis Mir over 3 years ago
The error is still valid for 11LTS since the StandaloneView
is still supported in 11LTS. From 12LTS it will be gone. That means the templatePathAndFilename
can still be used in 11LTS. (including the {@format}
wildcard which causes the error)
Updated by Gerrit Code Review over 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68881
Updated by Oliver Bartsch over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d5f8ce55b0a8e256d3bb580cba86f20778373501.
Updated by Gerrit Code Review over 3 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68882
Updated by Oliver Bartsch over 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset 5d5a041d8653afba3c4074672056f88372b75e1e.
Updated by Andreas Häfner over 3 years ago
- Has duplicate Bug #90987: EmailFinisher use only plaintext Fluid template added