Changing language for 'password reset' e-mail

10 views
Skip to first unread message

Wouter Hendriks

unread,
Jul 3, 2025, 3:12:57 PMJul 3
to General WebHare developers discussion
Hi,

How can I change/set the language for the default password reset e-mail? The one that is sent by HandleForgotPassword in /wrd/lib/internal/auth/webdesignplugin.whlib? Trying to send it in English but it keeps being Dutch.

Checked `GetTidLanguage()` right before `QueueMailInWork`, it's "nl". Not sure whether this matters, because calling `SetTidLanguage("en");` at that place doesn't help.

The <html lang> is "en" and I've called `SetTidLanguage("en");` in the constructor of the main webdesign object. Also set `this->languagecode := "en";`. "Normal" getTids in my code work fine.

Since I'm using a `routerfunction="...#LoginRouter"`, also checked `webdesign->GetWRDAuthPlugin()`, it has "en" as languagecode.

Not sure if it matters but when aborting `this->PrepareAuthPageMail` in webdesignplugin.whlib , I can see that __webcontext.languagecode is "en".

So it all seems like it's set to "en", but the (gettids from the) mail and subject are in Dutch.


 

Arnold Hendriks

unread,
Jul 3, 2025, 3:47:17 PMJul 3
to General WebHare developers discussion, Wouter Hendriks
This is tested by https://my.webhare.dev/.system/jstests/?site=webhare_testsuite.testsitejs&mask=wrd.*authpages* and I see both tests sending the password reset in their language. 

What is the URL triggering the password reset endpoint, what RPC is it submitting to and what apply rules are in effect for those URLs?

Arnold Hendriks

unread,
Jul 3, 2025, 3:48:27 PMJul 3
to General WebHare developers discussion, Arnold Hendriks, Wouter Hendriks
Screenshot 2025-07-03 at 21.47.50.png

Wouter Hendriks

unread,
Jul 4, 2025, 7:30:27 AMJul 4
to General WebHare developers discussion, Arnold Hendriks, Wouter Hendriks
"What is the URL triggering the password reset endpoint, what RPC is it submitting to and what apply rules are in effect for those URLs?"

1. 'The URL triggering': this is the referer that calls http://localhost:8001/wh_services/publisher/forms/formSubmit I guess?
2. 'what RPC is it submitting to': guessing http://localhost:8001/wh_services/publisher/forms/formSubmit ? With this payload:
{
    "id": 1,
    "method": "formSubmit",
    "params": [
        {
            "url": "dealerwelen/login/?wrd_pwdaction=forgotpassword",
            "target": "mhpf3CaRc_LOHFsILhRp7oDxuGJZbIXhm3dCipFTL7r8NLfCjEtAKADN9D30QYgpbRg-MRKzjgzfJVeOadlQoDTrOpAWkzRFsQ-3I7F-6QNYe63DPw.sURcTC6D839gUeCb.pxcTlVpaj9KpAJRzzegEbg",
            "vals": [
                {
                    "name": "email",
                    "value": "wouter...@beta.webhare.net"
                }
            ],
            "extrasubmit": {}
        }
    ]
}

3. 'what apply rules are in effect for those URLs': any hint how to get these? Looked at the <apply> tab in Publisher inspect, but don't see anything about a language(code) in there. There's a probably a function somewhere that gets the apply rules for an URL?

Got the feeling it works here because English is the default(?), because I can't find any code that sets the language for the test (but could be me). Tried "wrd.auth.js.testwrdauth-authpages-nl (wrdauth)" to test an other language but it fails with a "Error: 0 elements match selector `[name=\"login\"]` in the testframe".

Arnold Hendriks

unread,
Jul 28, 2025, 7:32:37 AMJul 28
to General WebHare developers discussion, Wouter Hendriks, Arnold Hendriks
On Friday, July 4, 2025 at 1:30:27 PM UTC+2 Wouter Hendriks wrote:
"What is the URL triggering the password reset endpoint, what RPC is it submitting to and what apply rules are in effect for those URLs?"

1. 'The URL triggering': this is the referer that calls http://localhost:8001/wh_services/publisher/forms/formSubmit I guess?
 
2. 'what RPC is it submitting to': guessing http://localhost:8001/wh_services/publisher/forms/formSubmit ? With this payload:
{
    "id": 1,
    "method": "formSubmit",
    "params": [
        {
            "url": "dealerwelen/login/?wrd_pwdaction=forgotpassword",
            "target": "mhpf3CaRc_LOHFsILhRp7oDxuGJZbIXhm3dCipFTL7r8NLfCjEtAKADN9D30QYgpbRg-MRKzjgzfJVeOadlQoDTrOpAWkzRFsQ-3I7F-6QNYe63DPw.sURcTC6D839gUeCb.pxcTlVpaj9KpAJRzzegEbg",
            "vals": [
                {
                    "name": "email",
                    "value": "wouter...@beta.webhare.net"
                }
            ],
            "extrasubmit": {}
        }
    ]
}

you can decrypt the target using

$ wh crypt decrypt-server publisher:formtarget "Wo8eb5FQC-Um-bm5RZBIrpca7LJwqb9rHWm0vo7odveDdaycgp4FIzY9qexsYt3bLVeSAZcPfeAnwvTeozGrnP0LZobybtz3l9E9gfo.Q4l6XWXgf5snzTgY.cqmFx9uJakKae8pF-a2fPA"

which will show you the fsobj on your server,  eg:

{
  "formref": "",
  "fsobj": 151768,
  "incontext": 0,
  "name": "wrd:authpages#login"
}

either that fsobj or the params.url plus Origin: header should determine which access rules apply.


3. 'what apply rules are in effect for those URLs': any hint how to get these? Looked at the <apply> tab in Publisher inspect, but don't see anything about a language(code) in there. There's a probably a function somewhere that gets the apply rules for an URL?

then 'en' should as apply as a dfeault but I'm not seeing why you would see any dutch texts? 
 

Got the feeling it works here because English is the default(?), because I can't find any code that sets the language for the test (but could be me). Tried "wrd.auth.js.testwrdauth-authpages-nl (wrdauth)" to test an other language but it fails with a "Error: 0 elements match selector `[name=\"login\"]` in the testframe".

Works for me and for CI - is the iframe with the test page running on the same origin as the testpage? Might be a CORS issue otherwise.

 
Reply all
Reply to author
Forward
0 new messages