Skip to content

Commit 6b8ff26

Browse files
FluidEmail request handling in CLI commands (#6313)
Clarify usage of ViewHelpers with request objects and console commands. Releases: main, 13.4 Co-authored-by: Lina Wolf <[email protected]>
1 parent 40bf03d commit 6b8ff26

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Documentation/ApiOverview/Mail/Index.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ Set the current request object for `FluidEmail`
417417
In order to use ViewHelpers that need a valid current request, such as :ref:`t3viewhelper:typo3-fluid-uri-page`,
418418
pass the current request to the FluidEmail instance:
419419

420-
421420
.. code-block:: php
422421
423422
use TYPO3\CMS\Core\Mail\FluidEmail;
@@ -426,8 +425,12 @@ pass the current request to the FluidEmail instance:
426425
$email->setRequest($this->request);
427426
428427
Read more aboout :ref:`Getting the PSR-7 request object <getting-typo3-request-object>` in different
429-
contexts. In a context where no valid request object can be retrieved, such as in a
430-
:ref:`Console command <t3coreapi:symfony-console-commands>` the affected ViewHelpers cannot be used.
428+
contexts.
429+
430+
In a context where no valid request object can be retrieved, such as in a
431+
:ref:`Console command <t3coreapi:symfony-console-commands>` a valid frontend context need to be
432+
simmulated (`Simulating a frontend request in TYPO3 Commands <https://docs.typo3.org/permalink/t3coreapi:console-command-tutorial-fe-request-example>`_)
433+
or the affected ViewHelpers cannot be used.
431434

432435
Trying to use these ViewHelpers without a valid request throws an :doc:`error <t3exceptions:Exceptions/1639819269>`
433436
like the following:

0 commit comments

Comments
 (0)