2

I am using magento 2 rest api, when I try to run forgot password api for customer, it is showing an error message.

{"message":"Invalid value of \"%value\" provided for the %fieldName field.","parameters":{"value":"forgot_password","fieldName":"email type"}

I am using below api to send forgot password to user: {base-url}/rest/V1/customers/password

I have created email template with name forgot_password

I am sending three parameters: email,template and website

I would be great if anyone can help.

2

This is working for me:

{
   "email": "email@email.com",
   "template": "email_reset",
   "websiteId": 1
}

template - "email_reset" is not real template which you can create in admin. It is constant which I found in AccountManagenet.php.

Reference

  • Note that even though you must use "email_reset" for the "template" value, it will actually use your forgot_password template, as long as you have set it up to be the one used for this purpose at Stores > Configuration > Customers > Customer Configuration > Password Options > Forgot Email Template – Fernando Echeverria Jan 28 '17 at 4:18
  • @Manish, How to get reset password link by rest api. this email_reset only sending change password message. – Pushpendra Singh Jan 15 '18 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.