Hopefully this post will help assist in creating improved reset password emails, using the persons name (or any other details related to the User data type) along with access to dynamic data on the reset_pw page such as showing the Users first name on the reset password page, without them being logged in of course (covered in example below). Any questions please feel free to ask:
To start, create a new field on the User data type, this will set to text.
Where you have the reset workflow action (e.g. Signup / Login Popup), where the ‘Send password reset email’ work action occurs, you’ll need to set to generate a token only, so it can be saved in a workflow afterwards. But this means in the process of making the token, it will not trigger the email.
So after this step, you’ll either have to use another service to send e.g. SendGrid plugin or re-trigger a send password reset email, details below…
To re-trigger the send email without generating a new token again, use the standard email workflow action:
The added benefit is you’ll have a bit more control over the email as well.
Then we can send the reset email to the typed email address (reset password input). In the body of the email, a dynamic expression has been used to ‘Do a search for’ the Users data type to match a constraint of the email to the inputted reset value. This will search and find the Users name on a direct match, as the User will have a unique email assigned for each account.
The ‘Website home URL’ dynamic expression will use the whole website address and change depending if in version-test or not. Then this is pointed to the page reset_pw and ends with the parameter and token ‘?reset’.
Here is the email that the User would then receive (this example generated in version-test, otherwise in live, it would be without this prefix):
Then for the reset password link, this is just the home URL with the parameter ‘reset’ and the result of step 1 (the generated token).
The next step is to save the generated token from step 1. We can use the similar dynamic expression to find the right User to save this value to (searches to find the user matching the email and saves the token as text):
Now onto the ‘reset_pw’ page. Here we just need to add a text element, where the Users name will sit. Then add the dynamic expression to search for this value:
So its searching for a list of Users, with the contraint of the ‘Reset Token’ field to equal the parameter from the page. This is the reset token. Its generated as a parameter which is handy to grab by setting the name to reset.
Then to finish the expression, finding the 1st item, as the reset token generated by Bubble should be unique (like the unique IDs on entries) and then the field Name (or First Name depending your setup).
End result on the reset_pw page, pulling in the related dynamic data.
To speed things up, these workflows could be migrated to an API workflow to avoid wait time.