From 6171ba8a4866584bf8bf0c76b5b98e6d640bc11c Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Sun, 1 Oct 2023 10:52:59 +0200 Subject: [PATCH] [Mime] Add TemplatedEmail::locale() to set the locale for the email rendering --- mailer.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mailer.rst b/mailer.rst index 8dc952f2fb9..9815cf3ca65 100644 --- a/mailer.rst +++ b/mailer.rst @@ -791,6 +791,9 @@ for Twig templates:: // 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') + // pass variables (name => value) to the template ->context([ 'expiration_date' => new \DateTime('+7 days'), @@ -798,6 +801,11 @@ for Twig templates:: ]) ; +.. versionadded:: 6.4 + + The :method:`Symfony\\Bridge\\Twig\\Mime\\TemplatedEmail::locale` method + was introduced in Symfony 6.4. + Then, create the template: .. code-block:: html+twig pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy