Review main Merged

78111[BUGFIX] Name only the known sender in the SystemEmail footer

Thomas Hohn CR +2 V +2 Normal +87 −3 updated 11/19/26, 09:16

Commit message

The footer of the SystemEmail layout always rendered "This email
was sent by {sitename} from URL: {siteUrl}", no matter which of
both values was known. Emails sent from CLI, e.g. by the scheduler,
have no request with a host, so the footer ended in "from URL: -"
or a broken URL like "http:/". An empty site name produced
"This email was sent by from URL: ...".

The footer now builds a complete sentence from the values that
are available: the site name, the site URL, both of them, or none,
in which case the sentence is omitted. The URL is only shown if
the request knows a host. It is kept whenever it is known, as it
helps to tell several instances with the same site name apart.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Josua Vogel +1
    • Benni Mack +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Josua Vogel +1
    • Benni Mack +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 3

Files 3

Review log 6374

Show 4049 earlier messages
  1. Thomas Hohn uploaded patch set 1 03/13/23, 20:50

  2. core-ci voted on patch set 1 V +1 03/13/23, 20:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38889

  3. Oliver Klee voted on patch set 1 CR +1 03/13/23, 21:53

  4. Sybille Peters commented on patch set 1 CR -1 03/14/23, 07:01

    I would change the subject. This is not SystemStatusUpdateTask specific. This affects all FluidEmails which use the SystemEmail layout (which is also used in linkvalidator, test email etc.). Search for <f:layout name="SystemEmail" /> in the core to find the other places. So for example I would change the subject to "SystemEmail cleanup"
    Optional: You could also refer to the other issues in the commit message with e.g. Related: #100148 Related: #10010
  5. Thomas Hohn uploaded patch set 2 CR +1 V +1 03/14/23, 07:16

  6. Sybille Peters voted on patch set 2 CR +1 03/14/23, 07:18

  7. Thomas Hohn commented on patch set 1 03/14/23, 07:18

    Reply

    Ack

    Reply

    Ack
  8. core-ci voted on patch set 2 V +1 03/14/23, 07:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38903

  9. Oliver Klee voted on patch set 2 CR +1 03/14/23, 09:25

  10. Markus Klein voted on patch set 2 V +1 CR +1 03/14/23, 15:53

  11. Christian Kuhn commented on patch set 2 03/14/23, 16:32

    isn't this "Resolved: # ..." as well?
    issue number does not exist.
  12. Oliver Klee voted on patch set 2 CR 0 03/14/23, 16:51

  13. Thomas Hohn updated the commit message in patch set 3 CR +1 V +1 03/14/23, 16:54

  14. Thomas Hohn commented on patch set 3 03/14/23, 16:54

    Reply

    Ack

    Reply

    Should have been 100103
  15. Oliver Klee voted on patch set 3 CR +1 03/14/23, 16:56

  16. core-ci voted on patch set 3 V +1 03/14/23, 17:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38940

  17. Sybille Peters voted on patch set 3 CR +1 03/14/23, 17:11

  18. Christian Kuhn voted on patch set 3 V +1 CR +1 03/14/23, 17:50

  19. Oli Bartsch commented on patch set 3 03/14/23, 18:23

    Actually the SystemEmail Layout is by default used for all kind of E-Mails, e.g. ext:form. The siteUrl is alwasys the one from the current request and therefore domain dependant, while the sitename will always be the same in multi domain setups. I would therefore argue that the siteUrl is more interesting than the sitename. What do you think?
  20. Thomas Hohn commented on patch set 3 03/14/23, 18:42

    Reply

    Hi - depends on what the value is in the cli-context - the idea was to have the same information in the mail - independent of the calling scope.
  21. Oli Bartsch commented on patch set 3 03/15/23, 07:39

    Reply

    Got that. Anyways, I think this might be a notable change as most of the installations out there will use the default email layouts for their forms. If those do no longer display this information, we might want to add at least an important.rst.
  22. Thomas Hohn commented on patch set 3 03/15/23, 08:27

    Reply

    Ack
  23. Thomas Hohn uploaded patch set 4 CR +1 V +1 03/16/23, 15:15

  24. core-ci voted on patch set 4 V +1 03/16/23, 15:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39059

  25. Martin Kutschker commented on patch set 4 03/16/23, 17:29

    Is this the right ticket to tackle problems with emails when the loginLogo is within the filademin? <img src="{typo3.systemConfiguration.backend.loginLogo -> core:normalizedUrl()}" alt="TYPO3 Logo" height="41" width="150" /> IIRC there is some path sanity check which prevents the image within the filadmin. As a result sending of mails throws an exception. Simple solution: don't show login logo. It is not meant to be shown within an email by definition :)
  26. Thomas Hohn commented on patch set 4 03/16/23, 20:23

    Reply

    I think we should do this in a follow up issues
  27. Sybille Peters commented on patch set 4 03/17/23, 07:27

    Reply

    There are already issues and patches for the image. Please look at existing issue first if they cover this: https://forge.typo3.org/issues/93940 https://forge.typo3.org/issues/99350 patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75727
  28. Benni Mack rebased onto patch set 5 V +1 04/17/23, 07:15

  29. core-ci voted on patch set 5 V -1 04/17/23, 07:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40777

  30. Thomas Hohn updated the commit message in patch set 6 V -1 04/17/23, 11:34

  31. core-ci voted on patch set 6 V +1 04/17/23, 11:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40798

  32. Andreas Kienast commented on patch set 6 CR -1 04/25/23, 06:49

    The ReST belongs into a `12.4.x` directory now
  33. Thomas Hohn uploaded patch set 7 CR -1 V +1 04/25/23, 07:36

  34. Thomas Hohn commented on patch set 7 04/25/23, 07:37

    Reply

    Done
  35. core-ci voted on patch set 7 V +1 04/25/23, 07:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41202

  36. Markus Klein commented on patch set 8 V +1 04/25/23, 07:49

    Published edit on patch set 7.
  37. Markus Klein voted on patch set 8 V +1 CR +1 04/25/23, 07:50

  38. core-ci voted on patch set 8 V +1 04/25/23, 07:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41204

  39. Oliver Klee voted on patch set 8 CR +1 04/25/23, 08:07

  40. Benni Mack updated the commit message in patch set 9 CR +1 V +1 05/03/23, 09:48

  41. Thomas Hohn rebased onto patch set 10 05/24/23, 04:59

  42. core-ci voted on patch set 10 V +1 05/24/23, 05:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41996

  43. Markus Klein voted on patch set 10 V +1 CR +1 05/24/23, 07:40

  44. Oliver Klee voted on patch set 10 CR +1 05/24/23, 08:00

  45. Anja Leichsenring commented on patch set 10 V -1 05/25/23, 04:10

    Late to the party, sorry about that. I managed to receive two completely similar emails from two different instances with this change. Before: 1. This email was sent by Home from URL: https://master.ddev.site/- Please 2. This email was sent by Home from URL: https://v11.ddev.site/- Please After: both This email was sent by Home - Please How am I supposed to distinguish which of my instances sent me this? The URL might not be very helpful in a multi site context, but at least if gives me a clue. And while the root page might not be exactly editors land, it can still change and no one makes sure it is unique in whatever context. Therefor, I oppose the change. Something unique, that allows the sending instance to be identified easily, should be in there.
  46. Benni Mack commented on patch set 10 07/06/23, 10:38

    Ping. Can we somehow continue here? Anja's Feedback seems valid
  47. Benni Mack wrote 07/06/23, 10:38

    Removed cc Benni Mack.
  48. Thomas Hohn commented on patch set 10 07/06/23, 10:52

    Reply

    Hi - sorry for the delay. One of the problems seems to the that {normalizedParams.siteUrl} isn't defined in the CLI context. Most of my "jobs" run in the CLI context and hence the URL will be empty. If there is some other place the URL of the site can be grabbed - we could put it back.
  49. Sybille Peters commented on patch set 10 07/06/23, 11:01

    Reply

    Can you add a condition to check if it is empty and only show the url (and "from URL") if not empty? So that you don't show "from URL:" and then an empty string in cli context. Additionally, you might be able to use sitename from TYPO3_CONF_VARS. (this is off the top of my head because I have not looked at it for a while, but also noticed the mails look ugly in cli context). Currently in v11, something like this is shown in footer (v11): "This email was sent by somethingsomething from URL: - Please contact"
  1. Thomas Hohn uploaded patch set 11 CR +1 V +1 07/06/23, 13:32

  2. Thomas Hohn commented on patch set 10 07/06/23, 13:33

    Reply

    Done
  3. core-ci voted on patch set 11 V +1 07/06/23, 13:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43743

  4. Jörg Bösche voted on patch set 11 CR +1 07/07/23, 10:59

  5. Oliver Klee voted on patch set 11 CR +1 07/15/23, 11:32

  6. Stefan Bürk commented on patch set 11 CR -1 07/24/23, 05:27

    Reply

    Minor remarks as further information: It's not new that in cli and be context things for the FE context need to be set. Things like: * a request object with the arguemens normalizedParam, site, language at least as global request and additionally injected * if extbase is used or things which needs fully operational extbase context, additionally things like page, TSFE and related things and arguments need to be set * a TSFE in a mocked form (slim) may be sufficient for most things * you should have siteConfigurations with full url (hostname + schema) and not only paths in older TYPO3 version there have been other things. Sadly, there is no easy "api" for that, and the TYPO3 core cannot determine "which to use" automatically. So you need to bootstrap this in cli. I have done this in project since ages and never had issues. For custom/own commands and operations, you could switch this on a record base for multi site/domain installation. Granted, we need to come up some day with something good for the cli context or have something at least a default one which is a valid context. Nothing which is easily done and needs multiple changes (and enforcements for the users I guess).

    SystemEmail.html:422

    If typo3.sitename is empty, the sentence would be cut in half.: ``` from Url: xxxx Please contact ... ``` Secondly, having not separator of any kind between the first sentance and the second looks weired: ``` from Url: xxxx Please contact ... This email was sent by <strong>{typo3.sitename}</strong> from Url: xxxx Please contact ... ``` I suggest to do here more a if-elseif-elseif-then quadruple chain and always build a fully line which makes sense and interpunctation. Note: Same counts for the plain text layout.
  7. Stefan Bürk commented on patch set 11 07/24/23, 05:37

    Reply

    You can override the template in that instance and remove that from the templates as a concrete implementation, if absolutly no url should be displayed in any emails. Or find a generic/unique sentence so people know which instance is meant.

    Important-100157-SystemEmailCleanup.rst:14

    It's not removed anylonger, at least not in any cases - or do I get here something wrong ?

    Important-100157-SystemEmailCleanup.rst:15

    That's a personal assumption, which quite some people have other opionions on it. We should avoid to state things like this here. This important rst file should be re-phrased and explain more in detail, that the template are changed to be more bullet proof in some scenarious. Additionally, it could be mentioned that in cli context a rqeuest should/could be created and provived to mitigate this issue and have control over it. Or doing it on a per record base determining the siteconfiguration along with the full url if configured (which is not required IMO - but most instance admin add them anyway as it solves a couple of issues.)
  8. Oliver Klee commented on patch set 11 10/08/23, 13:33

    How should we proceed here?
  9. Sybille Peters wrote 10/27/23, 05:05

    Removed reviewer Sybille Peters.
  10. Anja Leichsenring wrote 07/31/24, 18:16

    Removed reviewer Anja Leichsenring.
  11. Benni Mack updated the commit message in patch set 12 CR +1 V +1 10/18/24, 13:39

  12. Oliver Klee wrote 10/28/24, 10:47

    Removed reviewer Oliver Klee.
  13. Thomas Hohn abandoned the change 10/22/25, 12:46

    There seems to be no consensus on how to solve this properly.
  14. Benni Mack restored the change 11/09/26, 10:29

  15. Benni Mack uploaded patch set 13 11/09/26, 10:30

  16. Benni Mack commented on patch set 13 11/09/26, 10:32

    Important-100157-SystemEmailCleanup.rst:14 Reply

    yes. we dont need it.

    Important-100157-SystemEmailCleanup.rst:15 Reply

    agreed

    SystemEmail.html:422 Reply

    Done as you suggested: an if / else-if / else-if chain that always renders a complete sentence, in both the HTML and the plain text layout: - site name and host: "This email was sent by ACME Inc from https://example.com/."; - site name only: "This email was sent by ACME Inc." - host only: "This email was sent from https://example.com/."; - neither: the sentence is gone
  17. core-ci voted on patch set 13 V +1 11/09/26, 10:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113647

  18. Garvin Hicking commented on patch set 13 11/09/26, 11:05

    SystemEmail.fluid.txt:4

    How about emitting this string from within PHP as a regular variable, like the copyrightNotice? Two advantages: 1. We could try to use XLF labels for these strings more easily (detecting different translation scenarios) 2. None of that odd if/if/elseif logic in a fluid template that is annoying to adapt and maintain
  19. Benni Mack commented on patch set 13 11/09/26, 14:19

    SystemEmail.fluid.txt:4 Reply

    personally: I'd rather keep it as is now. People typically change the layout already anyways and can change it at will, it's really just the default / fallback design.
  20. Benni Mack voted on patch set 13 CR +1 V +1 11/09/26, 14:19

  21. Garvin Hicking commented on patch set 13 CR +1 V +1 11/09/26, 14:29

    SystemEmail.fluid.txt:4 Reply

    Fine with that. We can always outsource if people call for it later.
  22. Simon Schaufelberger voted on patch set 13 CR +1 V +1 11/15/26, 01:03

  23. Josua Vogel voted on patch set 13 CR +1 V +1 11/18/26, 15:37

  24. Garvin Hicking voted on patch set 13 CR +2 V +2 11/19/26, 07:20

  25. Garvin Hicking merged patch set 14 11/19/26, 09:16