What is Mautic 5 way of injecting custom templates

Great question! That was part of the PhpEngine. PHP templates were dropped in Symfony 4. So Mautic 5 had to drop the support for it as well in order to run on supported Symfony version.

I guess nobody noticed that the CoreEvents::VIEW_INJECT_CUSTOM_TEMPLATE event is no longer triggered anywhere.

KernelEvents::VIEW looks like the next best thing. I couldn’t find any events dispatched by the Twig dependencies.

I’ll create a PR to remove this dead code and document it in the upgrading doc.