忘记密码 API 在 magento 2.x 中不起作用
Forgot password API is not working in magento 2.x
我需要使用以下 REST API、
重置密码[忘记密码]
URL : {{base_url}}/index.php/rest/V1/customers/password
方法:PUT
正文:
{
"email": "test@gmail.com",
"template": "Forgot Password",
"websiteId": 1
}
收到以下回复,
{
"message": "Invalid value of \"%value\" provided for the %fieldName field.",
"parameters": {
"value": "Forgot Password",
"fieldName": "email type"
}
}
请帮帮我?
试试这个:
{
"email": "test@gmail.com",
"template": "Forgot Password",
"websiteId": 1
}
如果您的问题没有得到解决,请查看 Stores -> Settings -> All Stores -> Website
。在 URL 中,您可以找到您的 WebSiteID。
默认情况下 MainWebSite 有 id=1.
当我将模板设置为 email_reset
时它正在工作
{
"email": "test@email.com",
"template": "email_reset",
"websiteId": 1
}
[此 api 的 documentation 不正确。“email_reset”不是您可以在管理员中创建的真实模板。它是我在 AccountManagenet.php]
中找到的常量
{
"email": "test@gmail.com",
"template": "Forgot Password",
"websiteId": 1
}
我使用 "Forgot Password" 模板和 "websiteID":1.
我需要使用以下 REST API、
重置密码[忘记密码]URL : {{base_url}}/index.php/rest/V1/customers/password
方法:PUT
正文:
{
"email": "test@gmail.com",
"template": "Forgot Password",
"websiteId": 1
}
收到以下回复,
{
"message": "Invalid value of \"%value\" provided for the %fieldName field.",
"parameters": {
"value": "Forgot Password",
"fieldName": "email type"
}
}
请帮帮我?
试试这个:
{
"email": "test@gmail.com",
"template": "Forgot Password",
"websiteId": 1
}
如果您的问题没有得到解决,请查看 Stores -> Settings -> All Stores -> Website
。在 URL 中,您可以找到您的 WebSiteID。
默认情况下 MainWebSite 有 id=1.
当我将模板设置为 email_reset
时它正在工作{
"email": "test@email.com",
"template": "email_reset",
"websiteId": 1
}
[此 api 的 documentation 不正确。“email_reset”不是您可以在管理员中创建的真实模板。它是我在 AccountManagenet.php]
中找到的常量{
"email": "test@gmail.com",
"template": "Forgot Password",
"websiteId": 1
}
我使用 "Forgot Password" 模板和 "websiteID":1.