92483[FEATURE] Introduce TemplatedEmailFactory for centralized email creation
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Garvin Hicking +1
-
Verified V +2 Done
- Georg Ringer +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 33
- typo3/sysext/backend/Classes/Authentication/PasswordReset.php+4 −7
- typo3/sysext/backend/Classes/EventListener/FailedLoginAttemptNotification.php+7 −7
- typo3/sysext/backend/Classes/EventListener/FailedMfaAttemptNotification.php3+6 −5
- typo3/sysext/backend/Classes/Security/EmailLoginNotification.php+6 −5
- typo3/sysext/backend/Tests/Functional/Authentication/PasswordResetTest.php+6 −0
- typo3/sysext/backend/Tests/Unit/Security/EmailLoginNotificationTest.php+27 −15
- typo3/sysext/core/Classes/Mail/FluidEmail.php+8 −0
- typo3/sysext/core/Classes/Mail/TemplatedEmailFactory.php12new+220 −0
- typo3/sysext/core/Classes/ServiceProvider.php+6 −0
- typo3/sysext/core/Configuration/Sets/Email/config.yamlnew+2 −0
- typo3/sysext/core/Configuration/Sets/Email/labels.xlfnew+50 −0
- typo3/sysext/core/Configuration/Sets/Email/settings.definitions.yaml2new+25 −0
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-91724-TemplatedEmailFactory.rst8new+270 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_fluid_email/Resources/Private/Templates/EmailOverride0/WithSubject.fluid.htmlnew+9 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_fluid_email/Resources/Private/Templates/EmailOverride0/WithSubject.fluid.txtnew+6 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_fluid_email/Resources/Private/Templates/EmailOverride1/WithSubject.fluid.htmlnew+9 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_fluid_email/Resources/Private/Templates/EmailOverride1/WithSubject.fluid.txtnew+6 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_fluid_email/Resources/Private/Templates/EmailOverride2/WithSubject.fluid.htmlnew+9 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_fluid_email/Resources/Private/Templates/EmailOverride2/WithSubject.fluid.txtnew+6 −0
- typo3/sysext/core/Tests/Functional/Mail/TemplatedEmailFactoryTest.phpnew+406 −0
Show 13 more files
- typo3/sysext/felogin/Classes/Configuration/RecoveryConfiguration.php+0 −23
- typo3/sysext/felogin/Classes/Service/RecoveryService.php+8 −5
- typo3/sysext/felogin/Tests/Unit/Configuration/RecoveryConfigurationTest.php+0 −39
- typo3/sysext/felogin/Tests/Unit/Service/RecoveryServiceTest.php+5 −6
- typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php+18 −39
- typo3/sysext/form/Tests/Functional/Domain/Finishers/EmailFinisherTest.php+6 −3
- typo3/sysext/form/Tests/Unit/Domain/Finishers/EmailFinisherTest.phpdeleted+0 −174
- typo3/sysext/install/Classes/Authentication/AuthenticationService.php+17 −22
- typo3/sysext/install/Classes/Controller/EnvironmentController.php+3 −3
- typo3/sysext/install/Classes/ServiceProvider.php+5 −2
- typo3/sysext/linkvalidator/Classes/Task/ValidatorTask.php+16 −10
- typo3/sysext/reports/Classes/Task/SystemStatusUpdateTask.php4+8 −15
- typo3/sysext/workspaces/Classes/Notification/StageChangeNotification.php+10 −22
Review log 3549
Show 1724 earlier messages
-
Benni Mack uploaded patch set 1 01/23/26, 14:58
-
Benni Mack uploaded patch set 2 01/23/26, 15:01
-
core-ci voted on patch set 1 V -1 01/23/26, 15:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94180
-
core-ci voted on patch set 2 V -1 01/23/26, 15:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/94181
-
Simon Schaufelberger uploaded patch set 3
V -102/04/26, 15:12 -
core-ci voted on patch set 3 V -1 02/04/26, 15:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95051
-
Simon Schaufelberger uploaded patch set 4
V -102/04/26, 16:37 -
core-ci voted on patch set 4 V -1 02/04/26, 16:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95071
-
core-ci commented on patch set 4 02/04/26, 17:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95071
-
Simon Schaufelberger uploaded patch set 5
V -102/04/26, 23:34 -
core-ci voted on patch set 5 V +1 02/04/26, 23:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95085
-
Simon Schaufelberger voted on patch set 5 CR +1 V +1 02/05/26, 08:57
-
Benni Mack marked it ready for review 02/05/26, 09:16
-
Matthias Vogel commented on patch set 5 02/05/26, 10:01
-
Benni Mack commented on patch set 5 02/05/26, 10:27
FailedMfaAttemptNotification.php:51Replyoh good point, that was for testing purposes back then... -
Simon Praetorius commented on patch set 5 02/05/26, 11:30
Can we deprecate the direct usage of `new FluidEmail` then, e. g. by marking the constructor as `@internal`? -
Simon Schaufelberger commented on patch set 5 02/05/26, 11:52
Reply
I would not do it in this patch but would do a separate patch instead. -
Simon Praetorius commented on patch set 5 02/05/26, 12:29
TemplatedEmailFactory.php:34intentionally not final?TemplatedEmailFactory.php:101```suggestion * will take precedence, while existing numeric keys will be overwritten. ```TemplatedEmailFactory.php:103`string[]` as type annotationFeature-91724-TemplatedEmailFactory.rst:177```suggestion Extensions that send emails are encouraged to use the :php:`TemplatedEmailFactory` to create ``` ? -
Simon Praetorius commented on patch set 5 02/05/26, 12:30
Reply
Just want to make sure that this is the next step (still in v14) before we merge this. -
Matthias Vogel uploaded patch set 6
CR +1V +102/05/26, 15:22 -
Matthias Vogel commented on patch set 6 02/05/26, 15:22
FailedMfaAttemptNotification.php:51ReplyDoneTemplatedEmailFactory.php:34ReplyI Think this is ok, so you can XCLASS here. Otherwise we should add an interface.TemplatedEmailFactory.php:101ReplyDoneTemplatedEmailFactory.php:103ReplyDoneFeature-91724-TemplatedEmailFactory.rst:177ReplyDone -
Matthias Vogel commented on patch set 6 02/05/26, 15:22
Reply
Done -
Simon Schaufelberger voted on patch set 6 CR +1 V +1 02/05/26, 15:27
-
core-ci voted on patch set 6 V +1 02/05/26, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95172
-
Simon Praetorius commented on patch set 6 02/05/26, 21:32
TemplatedEmailFactory.php:114When testing this, I found it a bit confusing that the paths and the format entered in site settings are only used "sometimes", even though there is clearly a site context. For example, for EXT:form finishers they don't work. I understand that the whole merging can get complicated and could also introduce breaking changes, but it is confusing when you enter something as advertised and it gets ignored. -
Simon Schaufelberger commented on patch set 6 CR 0 V -1 02/06/26, 09:15
On itTemplatedEmailFactory.php:114ReplyThanks for testing. On it. -
Benni Mack uploaded patch set 7
V +102/18/26, 21:53 -
core-ci voted on patch set 7 V -1 02/18/26, 22:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96195
-
Benni Mack uploaded patch set 8
V -102/19/26, 15:15 -
core-ci voted on patch set 8 V +1 02/19/26, 15:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96262
-
Garvin Hicking commented on patch set 8 02/19/26, 23:12
TemplatedEmailFactory.php:114ReplyBut in this case if a consumer like EXT:form is thehigjer order" consumer, that specific config must have priority over the site config IMO. The highest soecificity would win, for me this is an exlected outcome. I want to be abke to style the form finisher mails differently than my "usual" other mails. Otherwise I would need to remove the form mail template configs so the override order can fallback to site request context?settings.definitions.yaml:3we need to use a labels.xlf file so these settings can be translated as others like ext:seo, felogin and the others Btw, reading this: we could offer a site set definition also for email sender name / address configuration, and logo:assets? This would make fluidmails to be site-specific finally....Feature-91724-TemplatedEmailFactory.rst:32This is unclear to me, is it: Site settings ?? Overrides ?? Global Overrides ?? Site Settings ?? Global Overrides ?? Global ?? Site Settings Maybe a clear order with arrows is clearer than "on top of ... before".Feature-91724-TemplatedEmailFactory.rst:160Better use DI to not make people believe they need to use it like this when "createWithOverride" is involvedFeature-91724-TemplatedEmailFactory.rst:211Oh here it is. Link to that from the top, or copy? Also maybe "(when a site and the set dependency is available)" for clarity that the dependency must be selected for a site?SystemStatusUpdateTask.php:104```suggestion // @todo DI should be used to inject the MailerInterface in v15.0 ```SystemStatusUpdateTask.php:116```suggestion // @todo DI should be used to inject the MailerInterface in v15.0 ``` -
Simon Praetorius commented on patch set 8 02/20/26, 15:53
TemplatedEmailFactory.php:114ReplyThat should still be possible via the paths specified in form config (yaml) if I understand the overriding chain correctly. However, the `format` option might be problematic because it can't be merged. Maybe the format needs to be part of the API as well to be able to set it? Maybe even establish a DTO for the overrides, similarly to `ViewFactoryData`? -
Benni Mack commented on patch set 8 02/27/26, 15:04
TemplatedEmailFactory.php:114ReplyComing from a practical PoV: Format is always overridden, (= null -> use default, otherwise: html, text or both), but cannot be merged. -
Garvin Hicking uploaded patch set 9
V +103/13/26, 06:41address merge conflict -
core-ci voted on patch set 9 V +1 03/13/26, 06:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97870
-
Garvin Hicking uploaded patch set 10
V +103/13/26, 08:16Adjust ReST file -
core-ci voted on patch set 10 V +1 03/13/26, 08:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97873
-
Garvin Hicking commented on patch set 10 03/13/26, 12:14
TemplatedEmailFactory.php:114ReplyThe problem here is/was that Site settings transfer a "stringlist" as a "list" (numerical indexes from 0..X) I believe. I'll address this in a patch. About "format" I agree with Benni, this can only be either authoritative (wins, when set in site settings) or implicative, but not mergeable. Listeners to BeforeMailerSentMessageEvent however could set the format as a last-resort basis.settings.definitions.yaml:3ReplyAdjusted within the patch. Adding further config options should must be done in a follow-up.Feature-91724-TemplatedEmailFactory.rst:32ReplyReworded this.Feature-91724-TemplatedEmailFactory.rst:160ReplyI see this now, it's because of AbstractTask. I've changed it.Feature-91724-TemplatedEmailFactory.rst:211ReplyAdjusted.SystemStatusUpdateTask.php:104ReplyDoneSystemStatusUpdateTask.php:116ReplyDone -
Garvin Hicking uploaded patch set 11
V +103/13/26, 12:16Fix Site Settings Gui assignment -
Garvin Hicking uploaded patch set 12 03/13/26, 12:45
fix tests -
core-ci voted on patch set 11 V -1 03/13/26, 12:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97889
-
core-ci voted on patch set 12 V +1 03/13/26, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97894
-
Garvin Hicking commented on patch set 12 CR +1 V +1 03/13/26, 13:07
I've spent the better of my day on this and changed some tests, mainly because using the Site Settings GUI did not provide the expected results. For this I now do a "different" array merge strategy which I think should do "the trick". Happy for feedback. We should get this in. -
Garvin Hicking commented on patch set 13
CR +1V +103/13/26, 13:17Published edit on patch set 12. -
Garvin Hicking voted on patch set 13 CR +1 V +1 03/13/26, 13:17
-
core-ci voted on patch set 13 V +1 03/13/26, 13:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97899
-
Georg Ringer voted on patch set 13 CR +2 V +2 03/13/26, 15:25
-
Georg Ringer merged patch set 14 03/13/26, 15:25
-
Lina Wolf commented on patch set 14 05/25/26, 13:05
Reply Unresolved
So if the constructor is internal and therefore deprecated, shouldnt it be mentioned in the changelog?
FailedMfaAttemptNotification.php:51