# Sending Login Link to Users by email

**URL:** <https://community.auth0.com/t/sending-login-link-to-users-by-email/90451>\
**Category:** Get Help\
**Tags:** passwordless-email, jwt, passwordless, magic-link, login, auth0\
**Created:** [September 12, 2022, 3:58pm UTC](https://community.auth0.com/t/sending-login-link-to-users-by-email/90451 "2022-09-12T15:58:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dephraiim](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dephraiim/32/39854_2.png) [@dephraiim](https://community.auth0.com/u/dephraiim)\
**Post date:** [September 12, 2022, 3:58pm UTC](https://community.auth0.com/t/sending-login-link-to-users-by-email/90451/1 "2022-09-12T15:58:59Z")

</div>

I have an application with a set of email for all the users who will be able to use it. I want to

1. Generate a Login Link for each user
2. Send it to their mail so that when they click on it, they will just be logged in.

My question is, how do I use Next-Auth to generate the login details for each user.

Magic Link is when a user will have to enter their mail first on the app and the login link is sent to them. I already have the users so how do I generate the link myself and send it to them straight away without coming to the app in the first place?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 12, 2022, 10:04pm UTC](https://community.auth0.com/t/sending-login-link-to-users-by-email/90451/3 "2022-09-12T22:04:22Z")

</div>

Hi @dephraiim,

Welcome to the Auth0 Community!

I understand that you like to send your users a login link via Email.

To do so, I recommend using a [Passwordless Authentication with Magic Links](https://auth0.com/docs/authenticate/passwordless/authentication-methods/email-magic-link) flow.

In this situation, you will need to first configure the Classic Universal Login experience with the **Lock (passwordless)** template:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/d/8d542392b3e37a47d7e6e856d958892c15dfbefb.png)

Then in the code, include the [`passwordlessMethod: link`](https://auth0.com/docs/libraries/lock/lock-configuration#passwordlessmethod-string-) property in the Auth0Lock object. For example:

```auto
var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
  passwordlessMethod: 'link',  
  //... redacted for brevity
 });

```

Once you have configured these steps, you can have the Magic Links sent to newly created users by calling the Authentication API’s [`/dbconnections/signup` endpoint](https://auth0.com/docs/api/authentication#signup).

> [@dephraiim](#):
>
> I already have the users so how do I generate the link myself and send it to them straight away without coming to the app in the first place?

Or if these users already exist, you can call the Authentication API’s [`/passwordless/start` endpoint](https://auth0.com/docs/api/authentication#get-code-or-link) to begin the Passwordless authentication flow.

I hope this helps!

If you have any other questions, please feel free to reach out.

Thank you.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 21, 2022, 6:09pm UTC](https://community.auth0.com/t/sending-login-link-to-users-by-email/90451/4 "2022-12-21T18:09:43Z")

</div>


