System generated email that is sent to the user (account approved, request new password etc) is able to override the users preferred language. Is there any good reason for this?
This could be reproduced by activating the locale module, enabling another language, create a new account with the new language as the preferred language. And then, logout and request a new password. The email will be sent in the sites default language, rather than the users preferred language.
In my opinion, the user should always receive the email in the language that she/he has chosen, with a fallback to the sites default language.
This is easy to achieve, with a simple modification to the _user_mail_notify() function and the corresponding function call in user_pass_submit(). But maybe there's a reason why this works the way it does?
Comment | File | Size | Author |
---|---|---|---|
#5 | 1197400-respect-prefered-user-language.patch | 820 bytes | IcePhenom |
#4 | 1197400-respect-prefered-user-language.patch | 821 bytes | webflo |
#1 | 1197400-user_mail_notify-1.patch | 1.77 KB | olofbokedal |
Comments
Comment #1
olofbokedal CreditAttribution: olofbokedal commentedThis patch applies my suggested changes.
Comment #2
AdamGerthel CreditAttribution: AdamGerthel commentedPatch needs testing
Comment #4
webflo CreditAttribution: webflo commentedI think the optional language argument in _user_mail_notify, but user_pass_submit should not pass the language from the current request.
Comment #5
IcePhenom CreditAttribution: IcePhenom at Odd Hill commentedUpdate patch for drupal 7.38
Comment #6
cilefen CreditAttribution: cilefen commentedComment #7
shortspoken CreditAttribution: shortspoken commentedI totally agree with @olofjohansson but it's still not fixed. I fiddled around a little bit but could not get it to work in Drupal 7-56.
Isn't there anyone out there who has a fix for this?
Comment #8
zuruckzugehen CreditAttribution: zuruckzugehen at Òmada Interactiva commentedIt's true. It doesn't work, either, for Drupal 7.63
Comment #9
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThe last patch does not apply anymore. Switching to needs work.
Probably the good idea will be also to test and verify the problem while using i18n module, as mentioned in the duplicate issue here: #1702468: account_activated email language depends on website language - not user preferred language, and check also this scenario (if it working, or not, and if it is a core responsibility to be working). See the steps to reproduce from the referenced issue: