Appearance
Return
Send email using WeWeb
Use the backend `Send Email` action in an API Endpoint or Event Trigger to send emails from your app.
TEMPLATE AVAILABLE
If you wish to skip the manual setup, there is a workflow template available called Send Notification Email. You can find it inside the templates available when creating an API workflow.
Steps at a glance
- Create an API Endpoint or open the Event Trigger that should send the email.
- Configure the backend
Send Emailaction. - Call the API from the
Interface, or let the Event Trigger run automatically. - Test it.
1) Create the workflow
Choose the setup that matches your use case:
- For a custom email flow, open the
Data & APItab, then open theAPI Endpointssubtab and create a new endpoint. - For auth emails, open the
Data & APItab, then open theBackend Workflowssubtab and go toEvent Triggers, then open the matching trigger such asOn email verification requestedorOn password reset requested.
2) Configure the email action
Inside the API Endpoint or Event Trigger:
- Add the backend
Send Emailaction if you did not start from the template. - Set the recipient, subject, and content.
- Choose whether you want text content, HTML content, or both.
- If you are in an API Endpoint, return a success response so your interface can react when the email is sent.
3) Call the workflow
If you created an API Endpoint:
- In the
Interface, add a button or form submit workflow. - Call your email API endpoint.
- Pass the values it needs, such as:
- Recipient email
- Subject
- Message
If you used an Event Trigger:
- Run the related auth action from the
Interface, such asSend verify email,Request password reset,Request magic link, orOTP - Request code. - WeWeb automatically fires the matching Event Trigger.
- The Event Trigger sends the email using the values it receives, such as
user.email,email,url, orotp.
4) Test it
- Run the interface workflow in preview.
- Confirm the API succeeds.
- Confirm the email arrives.
Use this for auth emails
The built-in Send Email action is now the default option for auth emails in WeWeb.
Email verification
- Trigger:
On email verification requested - Recipient:
user.email - Main value to include:
url - Example subject:
Verify your email
Password reset
- Trigger:
On password reset requested - Recipient:
user.email - Main value to include:
url - Example subject:
Reset your password
Magic link
- Trigger:
On magic link requested - Recipient:
email - Main value to include:
url - Example subject:
Your magic link
OTP
- Trigger:
On OTP requested - Recipient:
email - Main value to include:
otp - Example subject:
Your verification code
Simple auth email examples
Email verification:
html
<p>Hi,</p>
<p>Confirm your email address by clicking the link below:</p>
<p><a href="{{url}}">Verify email</a></p>Password reset:
html
<p>Hi,</p>
<p>Click the link below to reset your password:</p>
<p><a href="{{url}}">Reset password</a></p>Magic link:
html
<p>Hi,</p>
<p>Click the link below to sign in:</p>
<p><a href="{{url}}">Sign in</a></p>OTP:
html
<p>Hi,</p>
<p>Your verification code is <strong>{{otp}}</strong>.</p>Common pitfalls
The email sends from the wrong flow
- Use the backend
Send Emailaction inside an API Endpoint or Event Trigger. - Do not use the old
WeWeb Emailplugin for this guide.
The email does not arrive
- Check the API response first.
- If this is an auth flow, check the matching Event Trigger run.
- Then check the recipient address and spam folder.

