How to translate emails when sending them asynchronously with Symfony Messenger?
问题 I configured the Symfony mailer to send emails with messenger. https://symfony.com/doc/current/mailer.html#sending-messages-async I have my emails in two languages and I rely on the requests to detect the language, but now the emails are not translated. How can I get the messages to be translated in the language detected in the request? In my controller: $mailer->send( $user->email, $this->translator->trans('mails.recover.subject'), 'email/client/password-recovery.html.twig', compact('user',