<p>If you really want to change the password action url (not the password path) you can only do that in your Twig template and use the <code>|replace('actions/users/set-password', 'account/set-password')</code> filter.</p>

<p>The action url is hard coded in PHP and I would suggest you not to change it unless you know what you are doing. It would by default route to an action that does several important things and then redirects to the <code>passwordPath</code>.</p>

<p>So when you replace the route you should include the logic into your custom controller or create a site url rule to the default action </p>

CC BY-SA 4.0
2018-10-30T06:33:04.947Z
I’m not sure I understand. I want to be able to control the styling/templating of the set password page and hopefully load it at a URL I pick. I want it to work just like the docs I linked to suggest, I just can’t get the links in the reset password emails to link to my custom template. What could be wrong with my setup?
Simon Kuran
CC BY-SA 4.0
2018-10-30T06:38:19.170Z
So it's about changing the route as you described in your question but about changing the template path? Because these are two different topics. Setting another template path will only work if the user has no cp access and the `setPasswordPath` should work. Where does the link redirect you?
Robin Schambach
CC BY-SA 4.0
2018-10-30T18:15:09.930Z
I solved it. Thanks for pointing me in the right direction and clarifying that the URL is card coded.
Simon Kuran
CC BY-SA 4.0
2019-10-22T12:22:40.590Z
could you please explain how you solved it? I am in the same situation.
outline4
CC BY-SA 4.0
2019-11-28T00:17:17.153Z
`setPasswordPath` is looking a template and not a route. eg. `'setPasswordPath' => 'PathToMyTemplate'`
Jessica Talzor
CC BY-SA 4.0
2019-11-28T18:09:11.547Z
I'm confused. I have created a template at `templates/account/reset-password.twig` and then set `'setPasswordPath' => '/account/reset-password'`... which happens to be both the route and the template... but it still takes me to a Craft-style password page instead of my custom template. @SimonKuran how did you fix it?
iamkeir
CC BY-SA 4.0
2019-11-28T18:13:27.083Z
If the users have cp access they'll always see the craft style password form. Only site users will be redirected to the password path
Robin Schambach
CC BY-SA 4.0
2018-10-30T06:10:40.350Z
2018-10-30T06:10:40.350Z
Robin Schambach
<p>How do I change the link that's sent in a forgot password email that's sent to front end users in Craft 3? The <code>setPasswordPath</code> config isn't working for me.</p>

<p>The users don't have access to the CP. In my global config settings I have <code>'setPasswordPath' =&gt; '/account/set-password'</code> I have a template based on the <a href="https://docs.craftcms.com/v3/dev/examples/set-password-form.html" rel="nofollow noreferrer">doc's Set Password Form example</a> that loads at <em>mysite.test/account/set-password</em>.</p>

<p>The email is sent via a template that is based on the <a href="https://docs.craftcms.com/v3/dev/examples/forgot-password-form.html" rel="nofollow noreferrer">doc's Forgot Password Form example</a>.</p>

<p>The links in the emails look like this: <em>mysite.test/<strong>actions/users/set-password</strong>?code=r8tyzUikpXko0b2o5A785TC73geK0jvh&amp;id=a91a64a3-8869-4f0d-a11b-2ad54d69303c</em></p>

<p>I want them to link to my template like this: <em>mysite.test/<strong>account/set-password</strong>?code=r8tyzUikpXko0b2o5A785TC73geK0jvh&amp;id=a91a64a3-8869-4f0d-a11b-2ad54d69303c</em></p>

<p>What am I doing wrong?</p>

<templating><craft3><users><config><password>
Craft 3 setPasswordPath config not working for front end users
# Craft 3 setPasswordPath config not working for front end users

(Asked by: username_0 on 2018-10-30)

How do I change the link that's sent in a forgot password email that's sent to front end users in Craft 3? The `setPasswordPath` config isn't working for me.

The users don't have access to the CP. In my global config settings I have `'setPasswordPath' => '/account/set-password'` I have a template based on the [doc's Set Password Form example](https://docs.craftcms.com/v3/dev/examples/set-password-form.html) that loads at *mysite.test/account/set-password*.

The email is sent via a template that is based on the [doc's Forgot Password Form example](https://docs.craftcms.com/v3/dev/examples/forgot-password-form.html).

The links in the emails look like this: *mysite.test/**actions/users/set-password**?code=r8tyzUikpXko0b2o5A785TC73geK0jvh&id=a91a64a3-8869-4f0d-a11b-2ad54d69303c*

I want them to link to my template like this: *mysite.test/**account/set-password**?code=r8tyzUikpXko0b2o5A785TC73geK0jvh&id=a91a64a3-8869-4f0d-a11b-2ad54d69303c*

What am I doing wrong?

**Tags:** templating, craft3, users, config, password


---

## 1 answers

### Answer by username_1 on 2018-10-30. Score: 2 | Accepted answer

If you really want to change the password action url (not the password path) you can only do that in your Twig template and use the `|replace('actions/users/set-password', 'account/set-password')` filter.

The action url is hard coded in PHP and I would suggest you not to change it unless you know what you are doing. It would by default route to an action that does several important things and then redirects to the `passwordPath`.

So when you replace the route you should include the logic into your custom controller or create a site url rule to the default action

> **Comments:**
> **username_0**: I’m not sure I understand. I want to be able to control the styling/templating of the set password page and hopefully load it at a URL I pick. I want it to work just like the docs I linked to suggest, I just can’t get the links in the reset password emails to link to my custom template. What could be wrong with my setup?  
> **username_1**: So it's about changing the route as you described in your question but about changing the template path? Because these are two different topics. Setting another template path will only work if the user has no cp access and the `setPasswordPath` should work. Where does the link redirect you?  
> **username_0**: I solved it. Thanks for pointing me in the right direction and clarifying that the URL is card coded.  
> **username_2**: could you please explain how you solved it? I am in the same situation.  
> **username_3**: `setPasswordPath` is looking a template and not a route. eg. `'setPasswordPath' => 'PathToMyTemplate'`  
> **username_4**: I'm confused. I have created a template at `templates/account/reset-password.twig` and then set `'setPasswordPath' => '/account/reset-password'`... which happens to be both the route and the template... but it still takes me to a Craft-style password page instead of my custom template. @SimonKuran how did you fix it?  
> **username_1**: If the users have cp access they'll always see the craft style password form. Only site users will be redirected to the password path  

---

