@Zilloww - thanks, the patch worked for me. I am using Drupal 10.3.0.
@jsacksick - yes, I am using Symfony mailer...
@pday -
I tried to implement your method. I created a file with your code (changed TEXT_TO_REPLACE with ---). I also added the PHP start and end tag to the file and enabled the module... It does nothing. "---" shows up in the menu.