2013-03-13 31 views

Odpowiedz

11

To dlatego, że wiadomość e-mail to treść uzyskana za pomocą tłumacza i masz złą konfigurację.

Sprawdź, czy masz tłumacza włączona:

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

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

Również jeśli napiszesz aplikację w innym języku niż angielski, upewnij się, że klucz registration.email.message przekłada się na niego. Jeśli tak nie jest, można zastąpić Tłumaczenia piśmie następujący plik:

# 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%. 
+0

, jeśli nadal się nie wyświetla. spróbuj wyczyścić pamięć podręczną. działa dla mnie po cp app/console cache: wyczyść –

+0

Działa idealnie. Wielkie dzięki. – mtchuente

0

Jest to domyślny FOSUser mail:

{% block subject %} 
{% autoescape false %} 
{{ 'registration.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }} 
{% endautoescape %} 
{% endblock %} 
{% block body_text %} 
{% autoescape false %} 
{{ 'registration.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }} 
{% endautoescape %} 
{% endblock %} 
{% block body_html %}{% endblock %} 

Na linii 8 „registration.email.message” oznacza zawartość e-mail . I trans jest filtrem zastępującym. Wypróbuj coś takiego:

{% block subject %} 
    {% autoescape false %} 
    {{ 'Confirmez votre inscription sur blabla.com'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }} 
    {% endautoescape %} 
    {% endblock %} 
    {% block body_text %} 
    {% autoescape false %} 
    {{ 'Bonjour %username% 

    Merci de cliquer sur le lien suivant afin de confirmer votre inscription sur blabla.com: 

    %confirmationUrl%'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }} 

{% endautoescape %} 
{% endblock %} 
{% block body_html %}{% endblock %}