Skip to main content

customers/reset_password

The customers/reset_password template renders the password reset page, which hosts the form to reset the password for a customer account.

Tip

Refer to the customers/reset_password template and its main section in Dawn for an example implementation.

An example of the customer reset password template in Dawn

The customers/reset_password template is located in the templates > customers directory of the theme:

└── theme
├── layout
├── templates
| └── customers
| ├── reset_password.json
| ...
...

You should include the password reset form in your customers/account template or a section inside of the template.

Tip

If you're using a JSON template, then any HTML or Liquid code needs to be included in a section that's referenced by the template.

Anchor to The password reset formThe password reset form

The password reset form can be added with the Liquid form tag and accompanying 'reset_customer_password' parameter. Within the form tag block, you need to include the following:

Inputtypename
Passwordpasswordcustomer[password]
Password confirmationpasswordcustomer[password_confirmation]

For example:

{%- form 'reset_customer_password' -%}
{{ form.errors | default_errors }}

<div className="password">
<input
type="password"
name="customer[password]"
id="password"
/>
<label htmlFor="password">Password</label>
</div>

<div className="password_confirm">
<input
type="password"
name="customer[password_confirmation]"
id="password_confirmation"
/>
<label htmlFor="password_confirmation">Confirm password</label>
</div>

<button>Reset password</button>
{%- endform -%}

When working with the customers/account template, you should familiarize yourself with previewing the template. To preview the customers/reset_password template, perform the following steps:

  1. Fill out the password recovery form on the login page.

  2. Check your email for the "Customer account password reset" email.

  3. Click the link in the email. This will take you to the customer password reset page.


Was this page helpful?