In Symfony 4, I could not get $this->getContainer()->get('templating')->render($view, $parameters); work.
I have set namespace usage for Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand and the extended ContainerAwareCommand class EmailCommand extends ContainerAwareCommand
I get an exception thrown
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] You have requested a non-existent service "templating".
For Symfony 4, this is the solution I came with.
First I installed Twig.
composer require twig
Then created his own Twig service.
<?php
Now my email team is as follows.
<?php
Francisco luz
source share