Custom redirect in verification email

We need to redirect users to different places after they verify their emails. We need this to be based on custom logic and thus the three variables available for use in the Dashboard (such as clientId) are not useful for this purpose.

Is there a way in Auth0 we can trigger a verification email with a provided redirect URL? After digging for a bit, it seems the answer is no and the only option is to create an email verification ticket but that doesn’t work since we want the user to have to actually check their email.

Hi @mr-newell,

If those variables are not enough to trigger your conditional logic, you will likely have to make your own email templating system. The email templates we provide are a on-size-fits-all pattern, and obviously some use-cases will be missed with that type of compromise.

To make a fully customized setup, you could create a backend service that does your conditional logic, calls the management api verification ticket endpoint to generate a url with your desired redirect, then sends the url in a verification email via a email provider of your choosing. You could call this service from a rule or hook on first authentication or signup with the info you desire.

Email redirects are something we have talked about quite a bit and we would like to get more feedback from you on the subject. If you could please describe your use case to our product team through our feedback page that would be very helpful. We use this info to implement new features in our product.

In addition, if you would like to describe your use-case with us, we could potentially provide some guidance. I understand that the conditional logic in the RedirectTo field is not sufficient for your redirects. Could you describe in more detail how you want the redirects to change?

Thanks,
Dan

Hi @dan.woda,

Thanks for the prompt response. To provide additional context, currently our main use case is to direct customers who enrolled through the enterprise flow to a different place than those enrolled through the small business flow.

It seems the easiest workaround at the moment to avoid sending our own emails would actually be to redirect the user to a temporary page which checks their metadata for the type of user they are (not something we currently have but it might be something we could add) and then use React routing to redirect them again to the actual page we want them to go to.

Thanks,

Matt

1 Like

That sounds like an easier route than making your own email service. Let me know if you need anything else on this!

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