Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Stale

75727[TASK] Embed the logo into TYPO3 system mails

Mario Lubenka CR 0 V 0 Hard +417 −17 updated 09/07/26, 06:53

Commit message

The logo in the header of the system mails TYPO3 sends was linked
with an absolute URL pointing back at the installation. A recipient
therefore only saw it while online and while that URL kept working:
renaming or removing the configured logo file broke the header of
every mail that had already been sent, and a mail sent from the
command line linked a URL assembled from the environment of the CLI
process.

The logo is now embedded into the mail as an inline part, referenced
as "cid:typo3_logo" from the HTML body. It travels with the mail and
is unaffected by later changes to the logo file. Which logo is shown
does not change.

Resolving it is left to the System Resource API, so every notation
the backend login screen accepts for "loginLogo" works for system
mails as well. A logo configured as a remote URL can not be embedded
and is linked as before, which the API expresses by resolving it to
a UriResource rather than a SystemResourceInterface. The alternative
text configured as "loginLogoAlt" is now honoured here, too.

FluidEmail reads the configuration through the class the backend
login screen already resolves its logo with, rather than through a
second implementation in EXT:core. EXT:core referencing EXT:backend
is deliberate: the two are mutually dependent, and it is better for
static analysis to see that than to have the dependency hidden. The
class is registered in the failsafe container along the way, since
the install tool sends system mails as well.

Two properties of symfony/mime shape the implementation. A part the
HTML body does not point to becomes a regular file attachment instead
of an inline part, so the logo is attached only after rendering has
shown that the mail references it - a custom template not rendering
the logo does not end up with it attached. And an attachment can not
be taken off a message again, so it has to be added only once, no
matter how often the body is generated.

The template picks the logo up as "{typo3.logo}", carrying the source
and the alternative text.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 21
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/27/75727/21 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/27/75727/21 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 3

  1. main 75981[BUGFIX] Uninitialized properties in DebuggerUtility Based on this change Merged Mario Lubenka CR +2 V +2 → 11.5 Easy +24 −2

    The chain has patch set 3 of 6, the changes above it need a rebase.

  2. main 75975[FEATURE] Username in password recovery mail Based on this change Merged Mario Lubenka CR +2 V +2 Easy +44 −0

    The chain has patch set 3 of 12, the changes above it need a rebase.

  3. 75727 [TASK] Embed the logo into TYPO3 system mails This change

Issues 2

Files 8

Review log 5778

Show 3753 earlier messages
  1. Mario Lubenka uploaded patch set 1 09/13/22, 15:33

  2. Mario Lubenka uploaded patch set 2 09/13/22, 15:39

  3. Simon Schaufelberger commented on patch set 2 CR -1 09/13/22, 15:42

    FluidEmail.php:67

    we are not in javascript world, therfor "else if" can be written as "elseif" here

    FluidEmail.php:74

    I'm not sure if the Environment would be a better source for the document root here. Make sure this also works in CI context!
  4. core-ci voted on patch set 1 V -1 09/13/22, 15:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31060

  5. core-ci voted on patch set 2 V -1 09/13/22, 15:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31061

  6. Mario Lubenka uploaded patch set 3 09/13/22, 15:50

  7. Mario Lubenka commented on patch set 2 09/13/22, 15:50

    FluidEmail.php:67 Reply

    Done

    FluidEmail.php:74 Reply

    The goal is to get the absolute path of the file. If there is a CI-proof way of doing so, please let me know. :)
  8. Simon Schaufelberger commented on patch set 3 09/13/22, 15:52

    FluidEmail.php:74 Reply

    As I said, the class \TYPO3\CMS\Core\Core\Environment provides all base paths
  9. core-ci voted on patch set 3 V -1 09/13/22, 15:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31062

  10. Benni Mack commented on patch set 3 09/13/22, 16:17

    SystemEmail.html:353

    what's "cid" ? :)
  11. Simon Schaufelberger commented on patch set 3 09/13/22, 18:20

    SystemEmail.html:353 Reply

    that is the way how to embed inline images in emails
  12. Mario Lubenka uploaded patch set 4 09/14/22, 06:27

  13. Mario Lubenka commented on patch set 4 09/14/22, 06:28

    Updated paths

    FluidEmail.php:74 Reply

    Done
  14. core-ci voted on patch set 4 V -1 09/14/22, 06:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31073

  15. Mario Lubenka uploaded patch set 5 09/14/22, 09:12

  16. core-ci voted on patch set 5 V +1 09/14/22, 09:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31077

  17. Mario Lubenka commented on patch set 5 09/14/22, 09:25

    FluidEmailTest.php:64

    Not sure why format changed here. In any case I made sure to only add the logo for HTML format. Embedding the logo changes the media subtype to "related" for HTML and BOTH format
  18. Stefan Bürk commented on patch set 5 09/17/22, 19:44

    I think, this should be done as FEATURE and with some kind of option (opt-in or opt-out). Embeding images in mails may leead to increased spam detection, depending on recieving servers. There are spam filtes out in the wild. So we should not hard enforce this here. It would mean, that we had to hack/patch the core to revert the embending if this goes in in the current implementation in the future. I get the point with "missing" image after a longer time - we personally have static hosted images for images and resources used in mails, which will not be deleted. Granted, that helps not with offline mail viewing .. but is than a missing image not a real issue. It's offline view of a html mail. And I would not take this as task .. and not as backport. I would guess, that backporting this would get regression voices raised. This just from viewing. Not tested the patch itself yet. >> This should be changed to a FEATURE with opt-in option (must be explicitly enabled) and main only
  19. Mario Lubenka uploaded patch set 6 09/19/22, 09:17

  20. Mario Lubenka commented on patch set 6 09/19/22, 09:20

    Reply

    I changed it to a FEATURE for v12 only. We'll be applying it to our v11 project via Composer patches then until we can upgrade to v12 sometime next year.
  21. Mario Lubenka commented on patch set 6 09/19/22, 09:20

    SystemEmail.html:353 Reply

    Done
  22. core-ci voted on patch set 6 V -1 09/19/22, 09:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31260

  23. Mario Lubenka uploaded patch set 7 09/19/22, 09:50

  24. core-ci voted on patch set 7 V -1 09/19/22, 09:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31262

  25. Mario Lubenka uploaded patch set 8 09/19/22, 10:01

  26. core-ci voted on patch set 8 V +1 09/19/22, 10:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31263

  27. Simon Schaufelberger commented on patch set 8 09/19/22, 11:58

    FluidEmail.php:63

    please don't touch code that doesn't need to be changed.
  28. Anja Leichsenring commented on patch set 8 09/19/22, 16:49

    now a feature.rst file is missing for the change to be ready
  29. Mario Lubenka uploaded patch set 9 09/20/22, 06:05

  30. Mario Lubenka uploaded patch set 10 09/20/22, 06:10

  31. Mario Lubenka commented on patch set 10 09/20/22, 06:10

    FluidEmail.php:63 Reply

    Done
  32. core-ci voted on patch set 9 V +1 09/20/22, 06:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31302

  33. core-ci voted on patch set 10 V +1 09/20/22, 06:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31303

  34. Georg Ringer commented on patch set 10 10/01/22, 20:01

    I would be in favor of no extra setting. always provide the logo path to the template + the embeddedLogo if possible (E.g. not if a an external URL is provided). if available, always embed. what do you think?
  35. Benjamin Franzke commented on patch set 10 10/01/22, 20:03

    Reply

    +1
  36. Benni Mack commented on patch set 10 10/01/22, 21:40

    Reply

    yes. let's drop the option then
  37. Mario Lubenka uploaded patch set 11 10/04/22, 06:33

  38. Mario Lubenka commented on patch set 11 10/04/22, 06:34

    Reply

    Option dropped again :)
  39. core-ci voted on patch set 11 V +1 10/04/22, 06:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31965

  40. Georg Ringer commented on patch set 11 10/04/22, 06:44

    FluidEmail.php:193

    it is possible that this logo can not be retrieved e.g. when provided via https://domain.tld/logo.svg I propose to return an empty string or null then and in ::returnContent check if the logoPath is available. in the template use the existing code as fallback then. what do you think

    DefaultConfiguration.php:1400

    still there

    Feature-98343-EmbeddedFluidSystemEmailLogo.rst:22

    propose to change to "Install Tool". the LocalConfiguration file doesn't exist anymore since couple of days
  41. Mario Lubenka uploaded patch set 12 10/04/22, 07:04

  42. Mario Lubenka commented on patch set 11 10/04/22, 07:04

    FluidEmail.php:193 Reply

    Hm. I looked at the usage of `$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['backend']['loginLogo']` in Ext:backend. Here, external URLs just pass through. Therefore I would not add an additional check here and make it the responsibility of the TYPO3 integrator that is configuring a custom logo.

    DefaultConfiguration.php:1400 Reply

    Done

    Feature-98343-EmbeddedFluidSystemEmailLogo.rst:22 Reply

    Ah, good to know. Changed.
  43. core-ci voted on patch set 12 V +1 10/04/22, 07:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31966

  44. Mario Lubenka uploaded patch set 13 10/04/22, 10:17

  45. core-ci voted on patch set 13 V +1 10/04/22, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31972

  46. Chris Müller commented on patch set 13 10/04/22, 11:46

    Feature-98343-EmbeddedFluidSystemEmailLogo.rst:12

    fluid -> Fluid

    Feature-98343-EmbeddedFluidSystemEmailLogo.rst:20

    Please use 4 spaces for indenting, not tabs.
  47. Mario Lubenka uploaded patch set 14 10/04/22, 14:44

  48. Mario Lubenka commented on patch set 14 10/04/22, 14:45

    Thanks

    Feature-98343-EmbeddedFluidSystemEmailLogo.rst:12 Reply

    Done

    Feature-98343-EmbeddedFluidSystemEmailLogo.rst:20 Reply

    Done
  49. core-ci voted on patch set 14 V +1 10/04/22, 15:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31987

  50. Mario Lubenka uploaded patch set 15 10/05/22, 06:24

  51. Mario Lubenka uploaded patch set 16 10/05/22, 06:29

  52. core-ci voted on patch set 15 V +1 10/05/22, 06:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32021

  53. core-ci voted on patch set 16 V +1 10/05/22, 06:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32025

  1. Mario Lubenka commented on patch set 16 02/08/23, 13:07

    FluidEmail.php:193 Reply

    Can we proceed with this change as it is, or do we need to make changes to it?
  2. Chris Müller uploaded patch set 17 V +1 02/08/23, 17:40

  3. core-ci voted on patch set 17 V -1 02/08/23, 18:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37393

  4. Chris Müller uploaded patch set 18 V -1 02/08/23, 20:44

  5. core-ci voted on patch set 18 V +1 02/08/23, 20:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37410

  6. Sybille Peters commented on patch set 18 03/04/23, 10:48

    SystemEmail.html:353

    If a custom logo is used, the alt text "TYPO3 Logo" is not appropriate. Please use "Logo" or set the alt text as well via variables. See also: https://forge.typo3.org/issues/100081 I would like to abandon my patch in favor of this one. (Unfortunately, I had already pushed when made aware of this patch).
  7. Sybille Peters commented on patch set 18 03/14/23, 17:22

    SystemEmail.html:353 Reply Unresolved

    On second thought, I think for decorative logos (without functionality, e.g. without link) an alt text should not be used at all. So we could just remove the alt text entirely for the logo, see https://www.w3.org/WAI/tutorials/images/decorative/ If you agree, I can fix the merge conflict and make the change.
  8. Markus Klein commented on patch set 18 03/14/23, 21:39

    FluidEmail.php:193 Reply

    `\TYPO3\CMS\Backend\View\AuthenticationStyleInformation::getUriForFileName` has an explicit check whether this is a URL already or not. In that case here we fail due to prepending the slash
  9. Simon Schaufelberger commented on patch set 18 09/04/23, 02:54

    FluidEmail.php:193 Reply

    Mario,

    FluidEmail.php:193 Reply Unresolved

    Mario, I would like to motivate you to finish this patch and make it mergeable! ;)
  10. Anja Leichsenring wrote 07/31/24, 18:24

    Removed cc Anja Leichsenring.
  11. Benni Mack uploaded patch set 19 V +1 04/11/25, 18:37

  12. core-ci voted on patch set 19 V +1 04/11/25, 18:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77572

  13. Helmut Hummel commented on patch set 19 10/22/25, 09:50

    Once https://review.typo3.org/c/Packages/TYPO3.CMS/+/90675 is merged, implementation of this can be made much cleaner and more straightforward. my suggestion therefore is to wait until merge and continue here then
  14. Helmut Hummel voted on patch set 19 V -1 10/22/25, 09:50

  15. Sybille Peters wrote 10/22/25, 10:05

    Removed cc Sybille Peters.
  16. Benni Mack wrote 04/21/26, 14:54

    Removed cc Benni Mack.
  17. Benni Mack marked it work in progress 04/21/26, 14:54

  18. Benni Mack uploaded patch set 20 V +1 09/03/26, 22:05

  19. core-ci voted on patch set 20 V +1 09/03/26, 22:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107784

  20. Garvin Hicking commented on patch set 20 09/04/26, 06:35

    Important-98343-LogoOfSystemMailsIsEmbedded.rst:46

    We need to mention that setups with large logo files may considerable increase mail traffic when the template is used for many recipients (eg communities with notifications). We should note that custom templates can implement their own img tag with an EXT notation or using typo3.systemConfiguration.backend.loginLogo if this is not wanted? If you agree I can provide a wording suggestion.
  21. Garvin Hicking commented on patch set 21 V +1 09/04/26, 10:05

    Published edit on patch set 20.
  22. Garvin Hicking commented on patch set 21 09/04/26, 10:13

    Important-98343-LogoOfSystemMailsIsEmbedded.rst:46 Reply Unresolved

    please see my proposal
  23. core-ci voted on patch set 21 V +1 09/04/26, 10:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107851

  24. Markus Klein commented on patch set 21 09/06/26, 19:20

  25. Chris Müller wrote 09/07/26, 06:53

    Removed cc Chris Müller.