Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fosUserBundle sends email registration empty

so when i registre via fosUserBundle form on production env it sends an email to my gmail but there is no confirmation link in the email, there is just this

registration.email.message

in the title and in the body of the email, someone knows why ?

like image 987
Rachid O Avatar asked Mar 13 '13 22:03

Rachid O


1 Answers

It's because the email is content obtained using translator and you have wrong configuration.

Make sure you have the translator enabled:

# app/config/config.yml
framework:
    translator: { fallback: %locale% }

# app/config/parameters.yml
parameters:
    locale: en # default locale

Also if you write your app in different language than english, make sure the key registration.email.message is translated into it. If it's not, you can override the translations by writing following file:

# app/Resources/FOSUserBundle/translations/FOSUserBundle.{your_locale}.yml
registration:
    email:
        subject: Registration email subject
        message: |
            Here you can place the content of the email.
            It can be multiline and you even have access to
            variables %username% and %confirmationUrl%.
like image 124
tomas.pecserke Avatar answered Sep 17 '22 18:09

tomas.pecserke