Where to find ${resetpasswordlink} EL variable

I am having trouble in finding the EL expressions to set few variables for password reset links
i dont want to hard code it, instead i want to assign value to ${resetpasswordlink} variable .

Under “customization” tab, i do not see any option. Can somebody give info on how can we reassign them to new value. i am looking in dev Okta Settings

I think we dropped the ball on documentation. Good thing, there is an issue to have this added to the docs.

You’ll need to give a link that looks like this:

https://whatever.com/pathToPasswordReset?token=${recoveryToken}

Thanks. In what email template this {recoveryToken} will go. I tried to put under “Forgot Password” Template, it throws error, saying “Missing ${code}”

${code} is used for SMS, ${recoveryToken} is for email

I was able to update the resetPasswordLink by doing this. :point_up_2:
If you remove href=${resetPasswordLink} from the template, it’ll throw an error.
Instead add another href to your custom link below that and save the template.
Using this, I was able to get the updated custom link for reset password emails.

2 Likes

Thanks @vijet. This is so helpful

1 Like

Something odd is going on here for sure, email templates shouldn’t be complaining about ${code}, I went ahead and forwarded this to the team that owns the email template. Thanks, and glad you got it working!

1 Like

Yeah! Seems like hack to me, but i need to get it done

Ran into the same issue. @vijet’s hack applied. :slight_smile:

–Ray

1 Like

Customization Macros are documented here:
https://help.okta.com/en/prod/Content/Topics/Settings/Settings_Email.htm#customization-variables

This document lists the custom variables that are used for individual email templates. But it doesn’t mention how to set value for custom variables like {resetPasswordLink}. I want to be able to set this variable to point to SPA running on my custom domain. How do I do that? In addition, if I want to add a custom variable, how do I do that?

1 Like

Hi @hliang

At the moment we do not support creating or updating existing variables in the templates. If you would like to redirect your users to your SPA, the best solution would be to add in href your URL and the recovery token variable.

Hey @vijet :wave:

Thanks for the suggestion.

I set the 2nd href prop as described here:

but then I got a broken UI email (link does not work):

Do you know what may have caoused this ?
Or maybe there’s a better way to set a redirect after a successful password reset ?

Kind Regards,
Ivan

I’ve always just left the ${resetPasswordLink} in the email template, but moved into a hidden div, as seen in this guide: How to redirect users to a self-hosted Sign In Widget to bootstrap the recoveryToken and complete Password Reset | Okta Help Center

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.