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.

8

1 Answer 1

3

This is working for me:

{
   "email": "[email protected]",
   "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

2
  • 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 Commented Jan 28, 2017 at 4:18
  • @Manish, How to get reset password link by rest api. this email_reset only sending change password message. Commented Jan 15, 2018 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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