Skip to content

Commit

Permalink
magento#7366: GraphQL: Document password change mutations. Mutation: …
Browse files Browse the repository at this point in the history
  • Loading branch information
atwixfirster committed Jun 17, 2020
1 parent de38ab9 commit 618c491
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/_data/toc/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ pages:
url: /graphql/mutations/reorder-items.html
exclude_versions: ["2.3"]

- label: requestPasswordResetEmail mutation
url: /graphql/mutations/request-password-reset-email.html
exclude_versions: ["2.3"]

- label: revokeCustomerToken mutation
url: /graphql/mutations/revoke-customer-token.html

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions src/guides/v2.4/graphql/mutations/request-password-reset-email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
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 a reset password process for the registered customer before [resetPassword]({{page.baseurl}}/graphql/mutations/reset-password.html) mutation call.

## 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 with an URL to reset a password.

![Reset password email]({{ page.baseurl }}/graphql/images/reset-password-email.png)

Example of `Set a New Password` button reset URL:

```
https://<MAGENTOSITE>/customer/account/createPassword/?token=gh80pkjGdsPyiXc0sUUXswX1uGN7crUr
```

## Input arguments

Mutation contains a required `email` argument specified an email of customer.

## Output attributes

The `requestPasswordResetEmail` mutation returns `true` if reset password operation has been successfully initiated and email with a reset link has been sent. Otherwise returns `false`.

## Errors

Error | Description
--- | ---
`Cannot reset the customer's password` | General error message which appears on some internal system errors. The original error is logged and can be found in 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.` | The empty value is provided in the `email` argument.

0 comments on commit 618c491

Please sign in to comment.