Contact Form Notification Email API (2026): Tell the Site Owner a New Lead Submitted a Form with POST /emails
After your AI-built site already stores a contact-form submission, email the site owner a lead notice and an admin URL with Rovela POST /emails. This is not a submitter receipt and not a Webflow confirmation. Rovela does not store the lead.
A new-lead owner notice is not a submitter form receipt, a Webflow confirmation, or a marketing drip
When an AI-built website already stored a contact-form submission — a lead row with the visitor’s name, address, message, and an admin URL you minted — that receiver still has to tell the site owner: “You have a new contact form lead,” plus the admin URL you already have. That send is transactional email. It is not a newsletter, and it is not a rewrite of the Webflow form-submission confirmation, a generic email notification API tour, or a thank-you mail to the visitor. Those tutorials already exist. The Webflow article confirms to the submitter that their form was received. This article’s recipient is the owner or sales inbox, after your own lead record already exists. Rovela does not store the lead, run the AI website builder, or reply to the visitor — this is your own new-lead notice, sent through POST /emails. The call to action is “open the lead,” not “thanks, we got your form,” and not “join our list.”
If you also want to confirm receipt to the visitor, that is a second, separately idempotent message with a different recipient and a different key. Do not BCC the owner and the visitor on one send. There is no official SDK to install. Keep the Rovela key on the form receiver, not in the Framer, Lovable, v0, or Wix page script. Send from a domain you verified, with DKIM.
What you need before the first new-lead owner notification
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 that already stored the contact-form submission:
- Create an account. The free plan sends real mail. There is no separate sandbox, and no test key that behaves differently from production.
- Add and verify a sending domain (often a subdomain such as
mail.example.com). An unverified or foreignfromis 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. - Create an API key. A
sending_accesskey can send and nothing else — the right default for a production new-lead owner notification sender. Afull_accesskey can also read messages and events, and manage domains, templates, and webhooks. The full key is shown once. Keys look likere_…and go out as a bearer token (authentication, email API authentication). - Send with
POST /emails. - Confirm delivery in the dashboard, with
GET /emails/:idorGET /emails/:id/events(those reads needfull_accessor a dashboard session), or with a webhook.
from is a string in the documented form "Acme Forms <forms@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 new-lead owner notification, start with email API vs SMTP.
A form receiver that notifies the owner only after the lead and admin URL already exist
Contact forms on Lovable, v0, Framer, Squarespace, or a custom page should POST to your server. That server writes the lead, then notifies the owner. Do not send from the browser.
Do the product work first. Insert the lead (name, email, message, page URL, timestamp), mint an admin URL such as https://admin.example.com/leads/sub_331, and only then call the Send Email API. If the insert fails, do not send. The to address is the owner or a sales mailbox you already configured — not the visitor.
// Form receiver — never the public site script.
const adminUrl = `https://admin.example.com/leads/${leadId}`;
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": `form-lead-notice-${leadId}-owner`,
},
body: JSON.stringify({
from: "Acme Forms <forms@mail.example.com>",
to: "owner@example.com",
reply_to: lead.email,
subject: `New contact form lead from ${lead.name}`,
html:
`<p>${lead.name} submitted the contact form on ${pageUrl}.</p>` +
`<p>${escapedMessage}</p>` +
`<p><a href="${adminUrl}">Open lead</a></p>`,
text:
`${lead.name} submitted the contact form on ${pageUrl}.\n\n` +
`${lead.message}\n\nOpen lead: ${adminUrl}`,
tags: { type: "form-lead-notice" },
}),
});
if (!res.ok) {
const err = await res.json().catch(() => ({}));
throw new Error(`rovela ${res.status}: ${err.message || res.statusText}`);
}
const { id } = await res.json();
Use a sending_access key. reply_to is a documented field — setting it to the visitor’s address lets the owner reply from their mail app without putting the visitor in to. Escape the message body so a visitor cannot inject HTML into the owner’s inbox. If several owners should each get a copy, send separately (or use a documented batch of individual messages), and remember cc / bcc count toward the 50-recipient cap; a small owner list is usually one to.
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 new-lead owner notification. A stable key such as form-lead-notice-sub_331-owner 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 new-lead owner notification, use a single to: the site owner or sales inbox you already configured. 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 new-lead owner notification.
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 new-lead owner notification 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 form-receiver server path
Documented errors share one shape: statusCode, name, and message. Handle them once in the form-receiver server path.
- 400 — a missing required field, a
fromdomain 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. Readmessage; 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
Bearerprefix. A revoked key looks the same from the client’s point of view. - 403 — a valid
sending_accesskey used on a management or read endpoint such asGET /emails/:idorGET /domains. The message says which permission is required. Keep the send path onsending_access; usefull_accessor the dashboard for status reads. - 429 — the per-key rate limit. Retry with backoff. Do not fan out a burst of new-lead owner notification 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 form-receiver server path
After new-lead owner notification is accepted, delivery continues in the background. The form-receiver server path 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 new-lead owner notification 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).
What not to do in this new-lead owner notification
Do not put the Rovela key in the public site’s form script. Do not notify the owner through mailbox SMTP for every submission. Use the HTTP API.
Do not send this notice to the visitor, and do not treat it as the Webflow submitter confirmation. Do not dump an unsanitized HTML message into html. Do not invent a sandbox key. Do not poll GET /emails/:id from the form POST. Do not turn the notice into a marketing drip (transactional vs marketing).
Rovela will not create a CRM record. Your form receiver already did that, and the admin URL should open it.
A compact new-lead owner-notification checklist
- Verify a sending domain and create a
sending_accesskey (Quick Start). - Store the lead and mint the admin URL first.
- Call
POST /emailsfrom the form receiver, to the owner, withIdempotency-Key,html, andtext. - Keep the key off the public page; escape the visitor’s message.
- Use webhooks for bounces; a 200 only means accepted.
- If you also thank the visitor, send that as a second idempotent event.