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

Framework: Translator: {Fallback: "% locale%"} default_lock: Nl

Services

FOSMailer: @ FOS_UJ. Mailer. Twig_swift

Routing

fos_user_register: resource: "@ FOSUserBundle / resources / config / routing / registration.xml" Prefix: / {_ locale} / registreren

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:

$ request-> Setlokel ($ locale); // ($ locale = 'en_US') $ Mailer = $ this- & gt; Get ('fosmailer'); $ Mailer- & gt; SendConfirmationEmailMessage ($ user);

In the email template {{'foobar' | Trans}} tags that work perfectly fine. But I am also using {{confirmationUrl}} which is generated by FOSUser

This confirmation URL will still appear in an English mail:

/ nl / registreren / confirm / 1234 ..

Any ideas why my mail is localized but not my URL?

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

Popular posts from this blog

Folder list php -

java - org.apache.http.ProtocolException: Target host is not specified -