symfony - FOSUser mail is translated but confirmation_url isn't -
I found an easy way to add a location to my Symphony routes, as here:
Some of the relevant settings in my project:
Config
Services Routing I am trying to get FOSUser to send confirmation mail in the newly created user's browser language. For this, I am saving the place I have received by Javascript in my database. Then, I am setting up my request for that locale and manually send the confirmation mail: In the email template This confirmation URL will still appear in an English mail: Any ideas why my mail is localized but not my URL? Framework: Translator: {Fallback: "% locale%"} default_lock: Nl FOSMailer: @ FOS_UJ. Mailer. Twig_swift fos_user_register: resource: "@ FOSUserBundle / resources / config / routing / registration.xml" Prefix: / {_ locale} / registreren $ request-> Setlokel ($ locale); // ($ locale = 'en_US') $ Mailer = $ this- & gt; Get ('fosmailer'); $ Mailer- & gt; SendConfirmationEmailMessage ($ user); {{'foobar' | Trans}} tags that work perfectly fine. But I am also using {{confirmationUrl}} which is generated by FOSUser / nl / registreren / confirm / 1234 ..
The url address has not been translated because the localization of the URL address is not part of the Symphony 2 installation is.
To make the URL addresses local, you need to use some bundles that solve this problem, for example, or you can create your own solution.
Comments
Post a Comment