OpenEmail for Modulify
Send emailwith Modulify.
Paste one prompt and Modulify adds a server route that sends with your OpenEmail key.
Add transactional email to this app with OpenEmail. 1. Install the TypeScript SDK with npm install @openemail/sdk. 2. Read the API key from the OPENEMAIL_API_KEY environment variable, on the server only. Never send it to the browser and never commit it. 3. Write a sendEmail helper that calls init once, then openemail.emails.send. Send from an address on a domain verified in OpenEmail. 4. Put the send in a Next.js API route at src/pages/api/send.ts. 5. Pass an idempotencyKey built from the event, such as welcome:<userId>, so a retry never sends twice. 6. Send a welcome email when someone signs up, and log the id that comes back. SDK reference: https://openemail.uk/docs/sdk
Change the sender and the trigger to fit your app. The rest is how OpenEmail expects to be called.
Three steps,
then it sends.
- 01
Mint a key
Create a key that can send in Settings. The secret shows once.
- 02
Keep it secret
Add OPENEMAIL_API_KEY to the secrets in Modulify, never to the code.
- 03
Paste the prompt
Modulify installs the SDK and writes the send. Read the change, then run it.
What it writes.
One route, one call.
A typical result. Modulify may name the files differently.
src/pages/api/send.ts
import type { NextApiRequest, NextApiResponse } from 'next'import { init, openemail } from '@openemail/sdk'init({ apiKey: process.env.OPENEMAIL_API_KEY })export default async function handler(req: NextApiRequest, res: NextApiResponse) {const { email, name, userId } = req.bodyconst sent = await openemail.emails.send({from: 'Acme <[email protected]>',to: email,subject: `Welcome, ${name}`,html: `<p>Thanks for signing up, ${name}.</p>`,}, {idempotencyKey: `welcome:${userId}`,})res.status(200).json({ id: sent.id })}
Other tools
same prompt, same mailbox.
Mint a key.
Send something.
Full API, MCP and SDK access on every plan, the free one included.