> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailkick.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Emails

> Understanding email structure in Mailkick

## Overview

**Emails** are the templates you create and send to your recipients. Each email is a hierarchical structure of elements that define its content and appearance.

## Email Structure

An email in Mailkick contains:

* **Properties**: Metadata (name, description, subject, background color, width, padding)
* **Elements**: Hierarchical structure of simple elements (text, button, image) and structural elements (groups, flex-rows)
* **Style Library**: References to design tokens (colors, text styles, button styles, links)

## Creating an Email

<Steps>
  <Step title="Create a new email">
    Click "New Email" in your dashboard or email list.
  </Step>

  <Step title="Add elements">
    Use the toolbar to add simple elements (Text, Image, Button) or structural elements (Columns, Group).
  </Step>

  <Step title="Apply styles">
    Use tokens from your Style Library to apply consistent styling. Select a text element and choose a text style, or a button and choose a button style.
  </Step>

  <Step title="Add components">
    Insert reusable components from your library to speed up creation. Components maintain design consistency across emails.
  </Step>

  <Step title="Preview">
    Preview your email across different clients to ensure compatibility.
  </Step>
</Steps>

## Email Properties

Each email has configurable properties:

| Property        | Description            | Example                          |
| --------------- | ---------------------- | -------------------------------- |
| **Name**        | Email identifier       | "Welcome Email"                  |
| **Description** | Internal description   | "Sent to new users after signup" |
| **Subject**     | Email subject line     | "Welcome to Mailkick!"           |
| **Background**  | Email background color | White or brand color             |
| **Width**       | Content width          | `600px`                          |
| **Padding**     | Inner spacing          | `20px`                           |

## Element Hierarchy

Emails follow a tree structure:

* **Simple Elements** (text, button, image, separator, social)
* **Groups** (wrappers for multiple elements)
* **Multi-columns** (layouts with side-by-side content)
* **Components** (reusable blocks from your library)

## Email Properties Reference

### Background

The email background is applied to the entire email container. You can use:

* A specific color picker
* A color token from your Style Library

### Width

Controls the maximum width of the email content. Common values:

* `600px` - Standard email width
* `700px` - Wider layouts
* `100%` - Full width (rarely used)

### Padding

Adds spacing around the email content. Typically `20px` or `40px`.

<Warning>
  The padding is applied to the email container, not individual elements. Use groups or sections for inner spacing.
</Warning>

## Best Practices

<AccordionGroup>
  <Accordion title="Start with a structure">
    Plan your email layout first. Use groups to organize sections, flex-rows for multi-column layouts.
  </Accordion>

  <Accordion title="Use design tokens">
    Always use tokens from your Style Library instead of manual values. This ensures brand consistency and makes updates easier.
  </Accordion>

  <Accordion title="Test responsiveness">
    Multi-column layouts automatically stack on mobile, but test to ensure your email looks good on small screens.
  </Accordion>

  <Accordion title="Optimize images">
    Use optimized images and consider using Mailkick's image proxy for better delivery.
  </Accordion>

  <Accordion title="Preview before sending">
    Use the preview feature to see how your email looks across different clients before sending.
  </Accordion>
</AccordionGroup>
