Templating for emails

What is the recommended way to use the templating engine for HTML emails? I use the PhpRenderer, not Twig.

If you already use PhpRenderer, then why not use that as well.

Sure I want to use PhpRenderer, but I call it as $renderer->render($response, $templateFile, $params); or like $app->render($templateFile, $params). Do I need to make a mock response object for it, or how do I use it for emails?

In this case, you may try to use the fetch method instead:

$output = $renderer->fetch($template, $data, true);
1 Like

Okay, thanks! ********************