I am currently facing the problem that I want to create a reset-password-functionality by using a “multi-langual” theme and the locale of the user.
So, the message-body of the email is derived from the user-locale (if I understood correctly).
So when i click the link in the email, the default language of the theme is being triggered, although I want to use the user’s “locale-language”. Extending the url of the email link with <former_url>&kc_locale=<user_locale> leads to the effect I want I guess (the upcomming page is now using the right language, so to say). So might there be a possibility to extend an existing .ftl or property-file to add this locale-parameter to the link-url?
Hey DABO,
thanks for this useful information! I was thinking about the topic “action-token” too, since it is needed to execute the call //auth/realms/<client_id>/login-actions/action-token?key=<action_token> .
So this would basically mean that there might be the option of manually creating this link and add a query-parameter kc_locale= at the end of the url. The downside would be that the mail has to be created by yourself in different languages (which wont be too hard on the other hand).
I just found a workaround for myself by successfully extending the link with the query-parameter
kc_locale=:
This all happens in the executeActions.ftl which is located in the folder themes/base/email/text. This file contains the placeholders for generating the email-text and can be adjusted with some restrictions (see Freemarker-language). Since the placeholders are often derived from the language-specific property-files (located in themes/base/email/messages) , I created an own kc_locale property for each language and was able to use it as a “freemarker-variable” in the template.
Thanks again for the quick response and your thoughts on that!