Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit e85c9b3

Browse files
committed
#7366: GraphQL: Document password change mutations. Mutation: requestPasswordResetEmail.
- https://devdocs.magento.com/guides/v2.4/graphql/mutations/revoke-customer-token.html
1 parent de38ab9 commit e85c9b3

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

src/_data/toc/graphql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ pages:
213213
url: /graphql/mutations/reorder-items.html
214214
exclude_versions: ["2.3"]
215215

216+
- label: requestPasswordResetEmail mutation
217+
url: /graphql/mutations/request-password-reset-email.html
218+
exclude_versions: ["2.3"]
219+
216220
- label: revokeCustomerToken mutation
217221
url: /graphql/mutations/revoke-customer-token.html
218222

Loading
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
group: graphql
3+
title: requestPasswordResetEmail mutation
4+
contributor_name: Atwix
5+
contributor_link: https://www.atwix.com/
6+
---
7+
8+
The `requestPasswordResetEmail` mutation triggers the password reset email by the provided email address. Use it to initiate the process to reset the registered customer's password before calling the [resetPassword]({{page.baseurl}}/graphql/mutations/reset-password.html) mutation.
9+
10+
## Syntax
11+
12+
`mutation: {requestPasswordResetEmail(email: String!): Boolean}`
13+
14+
## Example usage
15+
16+
The following call triggers the password reset email.
17+
18+
**Request:**
19+
20+
```graphql
21+
mutation {
22+
requestPasswordResetEmail(
23+
email: "roni_cost@example.com"
24+
)
25+
}
26+
```
27+
28+
**Response:**
29+
30+
```json
31+
{
32+
"data": {
33+
"requestPasswordResetEmail": true
34+
}
35+
}
36+
```
37+
38+
Customer will receive an email that contains a URL for resetting their password.
39+
40+
![Reset password email]({{ page.baseurl }}/graphql/images/reset-password-email.png)
41+
42+
Example of `Set a New Password` button reset URL:
43+
44+
```text
45+
https://<MAGENTOSITE>/customer/account/createPassword/?token=gh80pkjGdsPyiXc0sUUXswX1uGN7crUr
46+
```
47+
48+
## Input arguments
49+
50+
You must specify the customer's email address in the `email` input argument.
51+
52+
## Output attributes
53+
54+
The `requestPasswordResetEmail` mutation returns `true` if both of the following operations are successful:
55+
56+
- The reset password operation initiates.
57+
- Magento sends an email containing a reset link.
58+
59+
Otherwise, the mutation returns `false`.
60+
61+
## Errors
62+
63+
Error | Description
64+
--- | ---
65+
`Cannot reset the customer's password` | A general error message that appears on some internal system errors. The original error is logged and can be found in the Magento logs.
66+
`The account is locked` | You cannot modify a locked customer account.
67+
`The email address has an invalid format.` | The value provided in the `email` argument has an invalid format.
68+
`You must specify an email address.` | An empty value is provided in the `email` argument.
69+
70+
## Related topics
71+
72+
* [resetPassword mutation]({{page.baseurl}}/graphql/mutations/reset-password.html)

0 commit comments

Comments
 (0)