← Back to blog

Lovable Transactional Email API (2026): Confirm a New User's Email in Your Lovable-Generated App with POST /emails

After your Lovable-generated app already creates the user and mints a confirm-email URL, send that confirmation with Rovela POST /emails. No official Lovable plugin. Rovela does not create Lovable users.

Updated November 12, 2026
Lovable Transactional Email API (2026): Confirm a New User's Email in Your Lovable-Generated App with POST /emails

A Lovable signup confirmation is not a generic AI-app primer, a coding-agent send, or a welcome tour

When Lovable has already generated a working web app — a signup form, a users table, and a confirm-email URL you minted after insert — that backend still has to tell the new user: “Confirm your email to finish signing up,” plus the confirmation URL you already have. That send is transactional email. It is not a product newsletter, not a drip sequence, and it is not a rewrite of the transactional email for AI apps overview, the send email from an AI coding agent guide, or the welcome email playbook. Those tutorials already exist. They describe a cluster of codes, invites, and login links across AI products, a coding assistant placing an HTTP send, or the first tour message after an account is fully usable. This article is one event in a Lovable-generated product: the user row exists, the email is not confirmed yet, and a single-use confirmation URL already exists. Rovela does not run Lovable, create accounts in your generated app, or talk to Lovable’s builder — this is your app’s own signup-confirmation event, sent through POST /emails. The recipient is the new user (the address you already stored). The call to action is “confirm your email,” not “here is a magic sign-in link,” not “you’ve been invited to a workspace,” and not “welcome, here’s how the product works.”

This guide does not invent an official Lovable plugin or a Rovela Lovable SDK. There is no client library to install. If Lovable’s hosting already offers a built-in mail switch, treat that as a separate path; the HTTP API is how you send from your verified domain, with DKIM, an Idempotency-Key, and webhooks you control. Keep the API key in the generated app’s server or edge function — the same place the signup already writes the user — not in client-side UI code.

A confirm-email link is not a verification code or a magic login link. The code vs link comparison explains when to use each. Here the account has just been created, and you are asking the person to prove they own the address before you mark email_confirmed_at. The token in the URL is yours. Rovela only delivers the message.

A server route in a generated web app records a new unconfirmed user and a confirm-email URL, then posts JSON with that URL to the email API and receives a message id

What you need before the first signup email confirmation

The first-email guide and the Quick Start are the same five steps, whether you call curl or a server-side fetch from the server route or edge function in your Lovable-generated app:

  1. Create an account. The free plan sends real mail. There is no separate sandbox, and no test key that behaves differently from production.
  2. Add and verify a sending domain (often a subdomain such as mail.example.com). An unverified or foreign from is refused with a 400 that names the domain. The dashboard asks for four DNS records — SPF, DKIM, DMARC, and return-path. See the domain setup guide, the Domains API, and what an email domain is.
  3. Create an API key. A sending_access key can send and nothing else — the right default for a production signup email confirmation sender. A full_access key can also read messages and events, and manage domains, templates, and webhooks. The full key is shown once. Keys look like re_… and go out as a bearer token (authentication, email API authentication).
  4. Send with POST /emails.
  5. Confirm delivery in the dashboard, with GET /emails/:id or GET /emails/:id/events (those reads need full_access or a dashboard session), or with a webhook.

from is a string in the documented form "Acme <hello@mail.example.com>". The address must sit on a verified sending domain. You prove you control the domain — that is what makes domain email trustworthy — before you speak as it. See the From name guide, the sending domains API, how email authentication works, how to set up domain email, and sending subdomain setup.

At least one of html, text, or template is required. template is a documented { id, variables } object and is mutually exclusive with html and text. Send both html and text where you can (HTML email API). Reusable copy can move to a template later; follow the templates guide. Examples here keep the copy inline.

Programmatic volume belongs on the HTTP email API, not on mailbox SMTP. Rovela SMTP is mailbox mail for Outlook, Apple Mail, or a phone: host mx.rovela.dev, port 465 with SSL/TLS, the mailbox’s full address, and a device credential (the same one that device uses for IMAP). A mailbox can send only as itself. For this signup email confirmation, start with email API vs SMTP.

A Lovable server route that sends only after the user row and confirm URL already exist

Lovable apps are often generated with a React (or similar) front end and a server path: a route handler, a server action, or an edge function that talks to your database. The confirmation email belongs on that server path. The browser can collect the address and call your signup endpoint; it must never hold a Rovela key.

Do the product work first, then the send. Insert the user (or the pending-signup row) with email_confirmed_at empty, mint a random token, store only a hash of that token, and build a confirm URL on your own domain, for example https://app.example.com/confirm-email?token=…. Only when that write has succeeded should the same server path call the Send Email API. If the insert fails, do not send. If the send fails with a retryable error, retry the HTTP call with the same Idempotency-Key; do not insert a second user.

There is no official Lovable SDK for Rovela. A standard fetch from the generated server code is enough:

// Server route or edge function in the Lovable-generated app — never the browser.
const confirmUrl = `https://app.example.com/confirm-email?token=${plainToken}`;

const res = await fetch("https://api.rovela.dev/emails", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ROVELA_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": `lovable-verify-email-${userId}-v${tokenVersion}`,
  },
  body: JSON.stringify({
    from: "Acme <hello@mail.example.com>",
    to: user.email,
    subject: "Confirm your email",
    html:
      `<p>Confirm your email to finish signing up for Acme.</p>` +
      `<p><a href="${confirmUrl}">Confirm email</a></p>` +
      `<p>This link expires in 24 hours. If you did not create an account, you can ignore this message.</p>`,
    text:
      `Confirm your email to finish signing up for Acme:\n${confirmUrl}\n` +
      `This link expires in 24 hours. If you did not create an account, you can ignore this message.`,
    tags: { type: "signup-confirmation", source: "lovable-app" },
  }),
});

if (!res.ok) {
  const err = await res.json().catch(() => ({}));
  throw new Error(`rovela ${res.status}: ${err.message || res.statusText}`);
}

const { id } = await res.json(); // {"object":"email","id":"..."}

Use a sending_access key in ROVELA_API_KEY. Put the confirm URL in both html and text. The token expiry is yours to enforce when the user opens /confirm-email — Rovela does not expire links. When the user clicks through, compare the presented token to your stored hash, set email_confirmed_at, and only then send a welcome email if you want a second, separately idempotent message. For the shape of a code-based alternative, see the verification-code example; this article stays on the confirmation link because that is the usual first signup event in a generated marketing site or SaaS shell.

Idempotency, recipients, and what a 200 actually means

Retries are normal. A server action, edge function, workflow, or queued job can time out after Rovela has already accepted the message. Send the documented Idempotency-Key header so a retry does not create a second signup email confirmation. A stable key such as lovable-verify-email-user_01-v3 is unique to this event, this recipient, and this token or invite version, and it stays the same when the HTTP call is repeated.

to accepts a string or an array. cc and bcc count toward billing and toward the documented cap of 50 recipients on one message. For a signup email confirmation, use a single to: the new user whose address you already stored. If you need an owner copy, send a second, separately idempotent message instead of BCC-ing a shared inbox.

A 200 from POST /emails means accepted for delivery, not arrived. The body looks like {"object": "email", "id": "9f1c2e40-..."}. Delivery is asynchronous. Read state with GET /emails/:id or GET /emails/:id/events (those need full_access or a dashboard session). In production, subscribe to a webhook for email.sent, email.delivered, email.bounced, and related events instead of polling from the request that minted the signup email confirmation.

If the address is on the suppression list, the send can still return an id, but the message is not delivered and its status becomes suppressed. Check Suppressions in the dashboard before assuming the API failed. Rate limits are per key; a 429 means retry with backoff. Each message in a POST /emails/batch request counts individually.

Optional documented fields include reply_to, scheduled_at (an ISO 8601 timestamp in the future), tags, headers, and attachments as { filename, content (base64), content_type }. This signup email confirmation does not need an attachment. To queue a later follow-up, use scheduled_at — not a sleep in the request path. A batch is appropriate only when you truly have many different messages, up to 100 per request.

Errors you should handle in the Lovable-generated server route

Documented errors share one shape: statusCode, name, and message. Handle them once in the Lovable-generated server route.

  • 400 — a missing required field, a from domain that is not in your organization or is still unverified, a template that does not exist, a base64 attachment that does not decode, or more than 50 recipients on one message. Read message; it often names the domain or the missing field. Do not retry a 400 in a tight loop.
  • 401 — missing or invalid credential, or a missing Bearer prefix. A revoked key looks the same from the client’s point of view.
  • 403 — a valid sending_access key used on a management or read endpoint such as GET /emails/:id or GET /domains. The message says which permission is required. Keep the send path on sending_access; use full_access or the dashboard for status reads.
  • 429 — the per-key rate limit. Retry with backoff. Do not fan out a burst of signup email confirmation sends from an unqueued loop.

A leaked sending_access key can send mail as your domain. Keep ROVELA_API_KEY in the server or edge-function environment, never in the browser, a mobile client, a public page, or a chat transcript (email API authentication). There is no official client SDK to install; a standard HTTPS call is enough.

Delivery is asynchronous — do not poll from the Lovable-generated server route

After signup email confirmation is accepted, delivery continues in the background. The Lovable-generated server route should store the returned message id next to your own event record and return to the user. Watching the message from that same request with a tight GET /emails/:id loop will slow the sign-up, invite, or form path and still needs full_access.

For production, configure a webhook and follow the webhook overview. Typical events include email.sent, email.delivered, email.opened, email.clicked, and email.bounced (event reference). Use bounces to keep your own list clean; do not invent a /logs API — the documented reads are GET /emails/:id, GET /emails/:id/events, the dashboard Emails view, and webhooks.

If a signup email confirmation landed in spam, start with DNS rather than the HTTP call: confirm the DKIM record is published at the selector the dashboard gave you, that you have exactly one SPF record, and that DMARC is not p=reject on a brand-new domain with no sending history. Reputation takes weeks, not minutes (how email authentication works).

A new user at a laptop opens a single transactional email titled Confirm your email with one large Confirm email button, not a welcome tour or a magic-link sign-in

What not to do in this Lovable signup confirmation

Do not ship the Rovela key in the Lovable front end, in a public env var prefixed for the browser, or in a screenshot you paste back into the Lovable chat. Do not point Nodemailer or a “quick SMTP” snippet at mx.rovela.dev to blast confirmations from the app — mailbox SMTP is send-as-self for a person or a small client, with a device credential and a documented 30 messages-a-minute ceiling from one client address. App signups belong on the HTTP API.

Do not treat this message as a welcome email or a marketing live-list campaign (transactional vs marketing). Do not attach a PDF, and do not invent a dedicated IP or a sandbox key — neither is in the public docs. Do not poll GET /emails/:id inside the signup request. Do not reuse an Idempotency-Key after you legitimately rotate the confirmation token; a new token version is a new key, such as …-v4.

Rovela will not click the link, will not mark the Lovable user confirmed, and will not talk to your database. Your /confirm-email route does that after a successful delivery and a successful click.

A compact Lovable signup-confirmation checklist

  • Verify a sending domain and create a sending_access key before the first confirm-email send (Quick Start).
  • Write the user and mint the confirm URL first; send only after that write succeeds.
  • Call POST /emails from the Lovable-generated server path with Idempotency-Key, html, and text.
  • Keep the key out of the browser and out of the Lovable prompt history.
  • Use webhooks to learn about bounces; a 200 only means accepted.
  • Send a welcome message later, as a second idempotent event, after the address is confirmed.