[5.x]: No way to control language of password reset email from the cp if user has no preferred language #17346
Unanswered
jeffOption5
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Description
When I go to a user's page in the control panel and click the 3 dots, then "Send password reset email", the email is always sent in the default site language.
To work around this, I added buttons to the sidebar in the control panel to send the email in different languages. These call a controller function that executes sendPasswordResetEmail.
The issue is that the email still gets sent in the default site language, because the user's preferred language is null.
I tested this with my admin account — when I change my preferred language in the CP (e.g. to English), it works as expected.
I tried setting the preferred language on the user in the controller, but it's read-only.
Is there a way to bypass that, or is there a better/easier way to handle this?
(Not sure if this qualifies as a bug or a feature request — feel free to re-label)
Steps to reproduce
Expected behavior
I would like the set preferredLanguage of the user and then send the email in that language.
Actual behavior
Can't set preferredLanguage of user because it is read only. So the email will always be in default language
Craft CMS version
5.7.2
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
Beta Was this translation helpful? Give feedback.
All reactions