Ranla + Bolt.new
Add transactional email to a Bolt-generated app with a .env secret and a chat prompt. Bolt often outputs Vite or React projects — keep sends on the server.
When to use Ranla
- Bolt prototypes that need real password-reset or notification email
- Moving from demo to production with your own sending domain
- Replacing a
RESEND_API_KEYpattern with Ranla (RANLA_API_KEY)
1. Add your API key
- Get a key from app.ranla.ai.
- In the Bolt project, add to
.env(local) and your host’s env UI when you deploy:
RANLA_API_KEY=rnl_your_key_here- Ensure
.envis in.gitignore— never commitrnl_keys.
If Bolt deploys to a platform with its own env panel (Netlify, Vercel, etc.), add the same variable there for production.
2. Paste this prompt in Bolt chat
Integrate Ranla transactional email into this project.
Docs:
- https://docs.ranla.ai/ai/agent-skill
- https://docs.ranla.ai/openapi.yaml
- https://docs.ranla.ai/builders/bolt
Rules:
1. Use RANLA_API_KEY from .env on the server only — never in client bundles or VITE_ prefixed vars.
2. POST https://api.ranla.ai/emails with Authorization: Bearer and JSON body (from, to, subject, html).
3. Until domain verification and Free production unlock (verified domain + payment method on file), sandbox from "[email protected]", to account email only.
4. Add a small API route or serverless function for transactional sends; do not call the API from the browser.
5. If this is Next.js, follow the App Router server pattern in https://docs.ranla.ai/frameworks/nextjs
After domain verify + payment method on file, use from on our verified domain for Free production. Upgrade for more volume.3. Server-only pattern
Bolt may generate a Vite SPA. Add a server endpoint (or deploy a small API route) that proxies to Ranla:
// Example: server handler (adapt to your Bolt stack)
export async function sendTransactionalEmail(payload: {
to: string
subject: string
html: string
}) {
const res = await fetch('https://api.ranla.ai/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RANLA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
from: process.env.MAIL_FROM ?? '[email protected]',
...payload,
}),
})
if (!res.ok) throw new Error(await res.text())
return res.json()
}Sandbox
Use [email protected] and your account email for the first test — see Quickstart.
Links
- Migration from Resend — field mapping if you started with Resend env names
- Next.js