# Email Theme

An **Email Theme** contains the global CSS stylesheet and typography rules applied to your transactional email communications. It standardises font families, container widths, color palettes, call-to-action (CTA) buttons, and element padding across all outgoing emails.

---

## How it works

1. **Create an email theme** — define a unique name, description, and status for your design theme.
2. **Customise CSS rules** — write custom CSS inside the `style` field to style `.container`, `.content`, `.field-table`, `.message-box`, `.cta-button-primary`, and other template components.
3. **Inject into emails** — the platform compiles theme styles directly into your rendered [Email Templates](/email-template) during transactional delivery.

---

## Fields

### Basic information

| Field | Type | Required | Max length | Description |
|---|---|---|---|---|
| `name` | string | ✅ | 256 | The unique name of the email theme |
| `description` | string | ❌ | 1 024 | A brief description of the email theme |
| `status` | enum | ✅ | — | `draft` · `live` · `paused` |

### Styling settings

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `style` | text | ❌ | *(Default CSS stylesheet)* | Global CSS stylesheet injected into email templates |

:::note
The default `style` stylesheet includes pre-configured styles for standard email layouts:

```css
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}
.container {
    max-width: 600px;
    margin: 40px auto;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}
.content {
    padding: 40px;
    color: #333333;
    line-height: 1.6;
}
.field-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}
.field-table tr {
    border-bottom: 1px solid #f0f0f0;
}
.field-label {
    width: 36%;
    padding: 10px 12px 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.field-value {
    padding: 10px 0;
    font-size: 15px;
    color: #333333;
}
.message-box {
    background-color: #f8f9fb;
    border-left: 3px solid rgb(124, 58, 237);
    border-radius: 4px;
    padding: 16px 20px;
    margin: 4px 0;
}
.cta-button-primary {
    margin-top: 30px;
    padding: 10px 20px;
    background-color: rgb(124, 58, 237);
    border-radius: 20px;
    color: #ffffff !important;
    text-decoration: none;
}
```
:::

---

## Real-world examples

**🎨 Modern Brand Email Theme**

```json
{
  "name": "Default Brand Theme",
  "description": "Standard corporate email theme with purple accent CTA buttons.",
  "style": "body { font-family: 'Inter', sans-serif; background-color: #f8fafc; } .container { max-width: 600px; margin: 30px auto; background: #ffffff; border-radius: 12px; } .cta-button-primary { background-color: #7c3aed; color: #ffffff; padding: 12px 24px; border-radius: 8px; font-weight: 600; }",
  "status": "live"
}
```

---

## Access & permissions

| Caller | Allowed operations | Notes |
|---|---|---|
| Admin | CREATE · GET · LIST · UPDATE · DELETE | Full management access |
| End user | *(none)* | No access |
| Guest user | *(none)* | No access |

---

## Related resources

| Resource | Description |
|---|---|
| [Email Template](/email-template) | Body content templates styled by email themes |
| [Email Header](/email-header) | Header wrappers placed above template content |
| [Email Footer](/email-footer) | Footer wrappers appended below template content |
| [Notification](/notification) | Active notification rules executing email templates |

---

## API reference

See the [API Reference](/api/email-theme) for full request/response schemas and interactive examples for:

- `GET /schema/email_theme/record` — list email themes
- `POST /schema/email_theme/record` — create an email theme
- `GET /schema/email_theme/record/{id}` — get an email theme by ID
- `PATCH /schema/email_theme/record/{id}` — update an email theme
- `DELETE /schema/email_theme/record/{id}` — delete an email theme
