79606680

Date: 2025-05-05 09:45:05
Score: 0.5
Natty:
Report link

Since Symfony 7+, it's possible to set the locale directly in the Symfony\Bridge\Twig\Mime\TemplatedEmail:

Example from the documentation:

$email = (new TemplatedEmail())
    ->from('[email protected]')
    ->to(new Address('[email protected]'))
    ->subject('Thanks for signing up!')

    // path of the Twig template to render
    ->htmlTemplate('emails/signup.html.twig')

    // change locale used in the template, e.g. to match user's locale
    ->locale('de')
;
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Thibault - Crovitche