Custom Flow Email Verification

We are using Auth0 Enterprise for our employees. As part of an initiative, we want to validate the employees logging in with personal email to validate their company email. Is there any solution available to trigger code to verify email or magic link?

Verify email with code appears for Adaptive MFA related scenarios. Appreciate any help. TIA :slight_smile:

Hi @krishram1,

Welcome to the Auth0 Community!

You can achieve this directly by Using the Management API in Actions, assuming that the personal email and the company email are under the same user’s profile, so the User Account Linking was already made.

You can set up flag in app_metadata, let say companyEmail_verified, and if the value is false then you can use the Auth0 Management API within the Action to either:

  1. send a verification email by calling the POST /api/v2/jobs/verification-email, which helps sending an Email Verification Job

  2. create a custom email verification flow that produces a link that can be used for email verification by calling the POST /api/v2/tickets/email-verification endpoint, which allows you to Create an email verification ticket

Then toggle this boolean flag accordingly, or rely on the email_verified option which should reside under the identities.profileData object for the secondary identity of the user.

The Customize Email Handling is the documentation in reference.

I hope this helps, and if you have further questions please let me know.
Thanks,
Remus