Appearance
On OTP requested
You can use this event to generate a one‑time code that can then be sent to the user to allow them to verify their email, sign in, or reset their password.
Interface actions that fire the
On OTP requested eventEvent data
| Display Key | Example Value | Description |
|---|---|---|
| "user@example.com" | The target user email to receive the OTP | |
| otp | "362941" | The one‑time passcode generated by WeWeb |
| type | email-verification | Context for the OTP request. This matches the OTP Type you selected in OTP - Request code: sign-in, email-verification, or forget-password. |
Example payload
json
{ "email": "user@example.com", "otp": "362941", "type": "email-verification" }Sending the OTP via email
To email the newly generated code to the user, use one of the email sending integrations available in WeWeb.
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 →
emailfrom the event data - Subject → e.g., “Your verification code”
- HTML/Text → include the
otpfrom the event data in the message body
- To →
Example HTML snippet:
html
<p>Hi,</p>
<p>Your verification code is: <strong>{{otp}}</strong></p>
<p>This code will expire shortly. If you didn’t request it, you can ignore this email.</p>
