This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#7366: GraphQL: Document password change mutations. Mutation: request…
…PasswordResetEmail. - https://devdocs.magento.com/guides/v2.4/graphql/mutations/revoke-customer-token.html
- Loading branch information
1 parent
de38ab9
commit e148bd6
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions
72
src/guides/v2.4/graphql/mutations/request-password-reset-email.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
group: graphql | ||
title: requestPasswordResetEmail mutation | ||
contributor_name: Atwix | ||
contributor_link: https://www.atwix.com/ | ||
--- | ||
|
||
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. | ||
|
||
## Syntax | ||
|
||
`mutation: {requestPasswordResetEmail(email: String!): Boolean}` | ||
|
||
## Example usage | ||
|
||
The following call triggers the password reset email. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation { | ||
requestPasswordResetEmail( | ||
email: "roni_cost@example.com" | ||
) | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"requestPasswordResetEmail": true | ||
} | ||
} | ||
``` | ||
|
||
Customer will receive an email that contains a URL for resetting their password. | ||
|
||
![Reset password email]({{ page.baseurl }}/graphql/images/reset-password-email.png) | ||
|
||
Example of `Set a New Password` button reset URL: | ||
|
||
```text | ||
https://<MAGENTOSITE>/customer/account/createPassword/?token=gh80pkjGdsPyiXc0sUUXswX1uGN7crUr | ||
``` | ||
|
||
## Input arguments | ||
|
||
You must specify the customer's email address in the `email` input argument. | ||
|
||
## Output attributes | ||
|
||
The `requestPasswordResetEmail` mutation returns `true` if both of the following operations are successful: | ||
|
||
- The reset password operation initiates. | ||
- Magento sends an email containing a reset link. | ||
|
||
Otherwise, the mutation returns `false`. | ||
|
||
## Errors | ||
|
||
Error | Description | ||
--- | --- | ||
`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. | ||
`The account is locked` | You cannot modify a locked customer account. | ||
`The email address has an invalid format.` | The value provided in the `email` argument has an invalid format. | ||
`You must specify an email address.` | An empty value is provided in the `email` argument. | ||
|
||
## Related topics | ||
|
||
- [resetPassword mutation]({{page.baseurl}}/graphql/mutations/reset-password.html) |