Appearance
On magic link requested
You can use this event to automatically generate a secure magic link that can be given to a user to sign in, or potentially sign up if they are a new user.
Interface actions that fire the
On magic link requested eventEvent data
| Display Key | Example Value | Description |
|---|---|---|
| "user@example.com" | The email input in the configuration of the Request magic link action in the interface | |
| token | "eyJhbGciOi..." | One‑time token generated by WeWeb that is needed in the URL in order to automatically sign the user in via the magic link |
| url | "https://your-domain.com/magic-link?token=...&redirect_url=..." | Complete, ready‑to‑use magic link (includes token and your redirects) |
Sending the magic link via email
To email the newly generated magic link to the user, you can utilize one of the various email sending integrations WeWeb has available.
View full list of email sending integrations →
Resend
As an example, let's walk through an example of sending the link via email using the Resend integration.
Steps:
- Add the
Send Emailaction from the available Resend actions - Bind fields of the action:
- To →
emailpassing in the event data - Subject → e.g., “Your magic link”
- HTML/Text → include the
urlfrom the event data in the message body
- To →
Example HTML snippet:
html
<p>Hi,</p>
<p>Click the link below to sign in:</p>
<p><a href="{{url}}">Sign in</a></p>
<p>This link will expire shortly. If you didn’t request it, you can ignore this email.</p>The magic link will be then sent to the user, and when the user clicks the link, they will be directed appropriately to the corresponding page as configured when the Request magic link action was called from the interface.

