---
title: "OpenEmail for GitHub Copilot"
description: "Add email to the app you build with GitHub Copilot: one prompt, an API key and the OpenEmail SDK, with sending, threads and webhooks."
url: "https://openemail.uk/developers/github-copilot"
---

[All developer tools](https://openemail.uk/developers.md)

OpenEmail for GitHub Copilot

# Send emailwith GitHub Copilot.

Paste one prompt and GitHub Copilot installs the SDK, keeps your key on the server and writes the send.

[Open GitHub Copilot](https://github.com/features/copilot)

Prompt for GitHub Copilot

```
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. Keep the send in server code, next to the code that creates users.
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.

1. 01
   
   Mint a key
   
   Create a key that can send in Settings. The secret shows once.
2. 02
   
   Keep it secret
   
   Put it in .env as OPENEMAIL\_API\_KEY and keep .env out of git.
3. 03
   
   Paste the prompt
   
   GitHub Copilot installs the SDK and writes the send. Read the change, then run it.

## What it writes. One route, one call.

A typical result. GitHub Copilot may name the files differently.

lib/email.ts

```
1import { init, openemail } from '@openemail/sdk'2 3init({ apiKey: process.env.OPENEMAIL_API_KEY })4 5export async function sendWelcome(user: User) {6  const sent = await openemail.emails.send({7    from: 'Acme <hello@acme.com>',8    to: user.email,9    subject: `Welcome, ${user.name}`,10    html: `<p>Thanks for signing up, ${user.name}.</p>`,11  }, {12    idempotencyKey: `welcome:${user.id}`,13  })14 15  console.log(sent.id)16}
```

Want GitHub Copilot to read your mail too?

Connect it over MCP to search threads, read them and reply, within the access you approve.

[Connect GitHub Copilot over MCP](https://openemail.uk/agents/github-copilot.md)

## Other tools same prompt, same mailbox.

- [Claude Code Coding agent Ask Claude Code to add sending to your codebase.](https://openemail.uk/developers/claude-code.md)
- [Cursor Coding agent Let the Cursor agent wire up sending in your repo.](https://openemail.uk/developers/cursor.md)
- [Codex Coding agent Hand Codex the prompt and review the change it makes.](https://openemail.uk/developers/codex.md)
- [Windsurf Coding agent Let Cascade add sending to your project.](https://openemail.uk/developers/windsurf.md)
- [Gemini CLI Coding agent Run the prompt in Gemini CLI from your project folder.](https://openemail.uk/developers/gemini-cli.md)
- [T3 Code Coding agent Paste the prompt into a T3 Code thread and review the diff.](https://openemail.uk/developers/t3-code.md)
- [v0 App builder Add a send route to the Next.js app v0 builds.](https://openemail.uk/developers/v0.md)
- [Bolt App builder Give the app Bolt builds a server route that sends.](https://openemail.uk/developers/bolt.md)
- [Lovable App builder Send from a Supabase Edge Function in your Lovable app.](https://openemail.uk/developers/lovable.md)
- [Replit App builder Add an Express route that sends from your Replit app.](https://openemail.uk/developers/replit.md)
- [Modulify App builder Add a send route to the Next.js site Modulify builds.](https://openemail.uk/developers/modulify.md)

## Mint a key. Send something.

Full API, MCP and SDK access on every plan, the free one included.

[Open mail](https://openemail.uk/mail/inbox) [Get Started](https://openemail.uk/signup.md)[Read the API quickstart](https://openemail.uk/docs/api/quickstart.md)
