I\'m working on application written in symfony2 and I want to send email after some action/event... the problem is, that the users can define something like \"email template
This work for me:
$loader = new \Twig\Loader\ArrayLoader([ 'Temp_File.html' => 'Hello {{ name }}!', ]); $twig = new \Twig\Environment($loader); echo $twig->render('Temp_File.html', ['name' => 'Fabien']);
https://twig.symfony.com/doc/2.x/api.html