> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.recursiv.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.recursiv.io/_mcp/server.

# Email

## Overview

The Email resource lets you send transactional emails (receipts, password resets, notifications) and manage email campaigns. When your organization has a BYOK Resend API key configured, emails are sent from your own account and domain.

All email methods are available on `r.email`.

## Transactional Email

### Send an email

```typescript
const { data: result } = await r.email.send({
  to: 'user@example.com',
  subject: 'Your order has shipped',
  html: '<h1>Order #1234</h1><p>Your package is on the way.</p>',
});

console.log(result.id);     // Resend message ID
console.log(result.status); // 'sent'
```

**Parameters:**

| Parameter  | Type                 | Required | Description                                     |
| ---------- | -------------------- | -------- | ----------------------------------------------- |
| `to`       | `string \| string[]` | Yes      | Recipient email(s).                             |
| `subject`  | `string`             | Yes      | Email subject line.                             |
| `html`     | `string`             | No       | HTML email body.                                |
| `text`     | `string`             | No       | Plain text email body.                          |
| `from`     | `string`             | No       | Sender address (defaults to org branded email). |
| `reply_to` | `string`             | No       | Reply-to address.                               |

### BYOK: Use your own email provider

Configure your own Resend API key in organization settings so emails come from your domain and your account:

```typescript
// Set your Resend API key (one-time setup)
await r.organizationSettings.updateByok(orgId, {
  resend_api_key: 're_your_resend_key',
});

// Now r.email.send() uses your Resend account
await r.email.send({
  to: 'customer@example.com',
  from: 'team@yourdomain.com',
  subject: 'Welcome to Our Platform',
  html: '<h1>Welcome!</h1>',
});
```

## Campaigns

For bulk email marketing, use the campaign methods:

| Method                                | Description                     |
| ------------------------------------- | ------------------------------- |
| `listCampaigns()`                     | List all campaigns.             |
| `getCampaign(id)`                     | Get campaign details.           |
| `getCampaignStats(id)`                | Get delivery statistics.        |
| `createCampaign(input)`               | Create a draft campaign.        |
| `importRecipients(campaignId, input)` | Import recipient emails.        |
| `startCampaign(id)`                   | Start sending a campaign.       |
| `pauseCampaign(id)`                   | Pause a sending campaign.       |
| `resumeCampaign(id)`                  | Resume a paused campaign.       |
| `sendBatch(id)`                       | Trigger next manual send batch. |
| `importSuppressions(input)`           | Add to suppression list.        |