v0
Add email to a v0 app
Generate a server route that sends through Transmitly with a scoped API key and durable acceptance.
Keep the Transmitly key on the server. v0 can generate the UI and route, but the send call belongs in a server action or API route, never in client code.
Connect
Add Transmitly to v0.
Prototyping a transactional email flow in a Next.js app.
import { Transmitly } from "@transmitly/sdk";
const tx = new Transmitly({ apiKey: process.env.TRANSMITLY_API_KEY! });
export async function POST(request: Request) {
const { email } = await request.json();
const result = await tx.emails.send({
from: "Notify <[email protected]>",
to: [email],
subject: "Welcome",
html: "<p>Your workspace is ready.</p>",
}, { idempotencyKey: `welcome:${email}` });
return Response.json(result);
}Use a dedicated API key. Read-only inspection needs the read scope; inbox replies also need send. Keep the key in an environment variable or secret manager.
What the agent can do
- Server-side send with a secret key
- Idempotent retries
- Per-recipient delivery state
- Signed webhooks for downstream state
Guardrails
- Use a verified sending domain before testing the route.
- Do not put the API key in a NEXT_PUBLIC_ environment variable.
- Return the message id and show accepted separately from delivered.
Example prompts
Ask for evidence, not invented success.
These prompts work well because they force the agent to read message and delivery state before writing code or drafting a reply.
“Add a server route that sends a welcome email and returns 202.”
“Use an idempotency key derived from the user id.”
“Do not expose the Transmitly key to the client bundle.”
“Add a webhook handler that verifies the signature.”
Keep going
Docs for the next step.
More app builders