Skip to content
Snippets Groups Projects
Commit 346a2f9d authored by Benni Mack's avatar Benni Mack
Browse files

[DOCS] Adjust documentation for Fluid-based templated emails

A feature regarding the subject and localization was missing
in the initial change / docs, so this is now added.

Resolves: #90463
Releases: master
Change-Id: Ic0de6abad93b45e3a176df016304bd3806997d7e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63343


Tested-by: default avatarBjörn Jacob <bjoern.jacob@tritum.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarBjörn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent 08f71888
Branches
Tags
No related merge requests found
......@@ -32,6 +32,9 @@ set this in your LocalConfiguration.php / AdditionalConfiguration.php file:
* :php:`$GLOBALS['TYPO3_CONF_VARS']['MAIL']['layoutRootPaths'][700] = 'EXT:my_site_extension/Resources/Private/Layouts';`
In addition, it is possible to define a section within the Fluid email,
which - if set - takes precedence over the :php:`subject()` method.
Impact
======
......@@ -51,4 +54,24 @@ It is possible to use the same API in your custom extension like this:
->assign('mySecretIngredient', 'Tomato and TypoScript');
GeneralUtility::makeInstance(Mailer::class)->send($email);
Defining a custom email subject in a custom template:
.. code-block:: html
<f:section name="Subject">New Login at "{typo3.sitename}"</f:section>
Building templated emails with Fluid also allows to define the language key,
and use this within the Fluid template:
.. code-block:: php
$email = GeneralUtility::makeInstance(FluidEmail::class);
$email
->to('contact@acme.com')
->assign('language', 'de');
.. code-block:: html
<f:translate languageKey="{language}" id="LLL:my_ext/Resources/Private/Language/emails.xml:subject" />
.. index:: Fluid, ext:core
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment