`hono-email/sendgrid` provides `SendGridAdapter` for the Twilio SendGrid Mail Send API. The adapter sends JSON directly to `/v3/mail/send` and maps SendGrid error responses to `SendEmailReceipt`.

## Example

```tsx
import { Body, Html, Text, sendEmail } from 'hono-email'
import { SendGridAdapter } from 'hono-email/sendgrid'

const receipt = await sendEmail({
  adapter: SendGridAdapter({
    apiKey: process.env.SENDGRID_API_KEY!,
  }),
  from: { address: 'sender@example.com', name: 'Sender' },
  to: ['recipient@example.com'],
  subject: 'Welcome',
  jsx: (
    <Html>
      <Body>
        <Text>Hello from SendGrid.</Text>
      </Body>
    </Html>
  ),
})
```

For the full list of configuration options, see the [SendGrid Options API Reference](/api/adapter-options/#sendgrid-options).

## Regional sending

Use `apiBaseUrl: 'https://api.eu.sendgrid.com'` for SendGrid EU regional sending.

## Shared adapter features

Like all provider adapters, SendGrid supports `to`, `cc`, `bcc`, `replyTo`, custom `headers`, and `attachments`. Inline attachments use `cid` when the provider supports content IDs.

## Options

import { Badge } from '@astrojs/starlight/components'

### `apiKey` <Badge text="Required" variant="caution" size="small" />

**Type:** `string`

Your SendGrid API key.

### `apiBaseUrl` <Badge text="Optional" variant="note" size="small" />

**Type:** `string` · **Default:** `'https://api.sendgrid.com'`

Override the SendGrid API base URL. Use `'https://api.eu.sendgrid.com'` for EU regional sending.

### `fetch` <Badge text="Optional" variant="note" size="small" />

**Type:** `(input: string, init: RequestInit) => Promise<Response>`

Custom `fetch` implementation. Defaults to `globalThis.fetch`.

### `userAgent` <Badge text="Optional" variant="note" size="small" />

**Type:** `string` · **Default:** `'hono-email'`

### `limits.maxAttachmentSize` <Badge text="Optional" variant="note" size="small" />

**Type:** `number`

Maximum attachment size in bytes.
