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) |
Send the magic link via email
For most projects, this Event Trigger should use WeWeb's built-in backend Send Email action.
Recommended setup
- Open
Data & API → Workflows → Event triggers. - Open
On magic link requested. - Add the backend
Send Emailaction. - Bind the recipient to
email. - Set a subject such as
Your magic link. - In the message body, include the
urlvalue from the event data so the user can sign in.
What you need to bind
- Recipient:
email - Subject: Your magic link email subject
- Content: The
urlvalue somewhere in the text or HTML
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>Alternative: use an email integration
If you need provider-specific features, you can use an email integration such as Resend, SendGrid, or Postmark instead.
View full list of email sending integrations →
The magic link will then be sent to the user, and when the user clicks the link, they will be directed to the matching page configured in the Request magic link action.

