# Create a campaign

> Walk through the five-step campaign wizard, from choosing audiences and the sender to content, testing and sending, and see exactly who receives it.

This guide walks through the campaign wizard step by step: picking recipients, setting the sender and subject, writing the content, testing it and sending it. It also explains who ends up receiving the campaign and how to do the same with the API.

## Before you begin

- Your workspace needs production access. Until then, campaigns can't be sent. See [Production access](/docs/workspaces/production-access/).
- Verify the domain you'll send from. See [Add a domain](/docs/domains/add-a-domain/).
- Create at least one [audience](/docs/audiences/) with subscribers.
- Optional: prepare a [template](/docs/templates/) to start the content from.

## Create the campaign

On **Email Marketing → Campaigns**, select **Add campaign**, enter a **Name** and select **Create**. The name is for you only. The wizard opens on its first step.

The steps are listed on the left. A check mark shows which ones are complete, and you can go back to any step. **Continue** saves the current step and moves to the next. While the campaign is a draft, you can leave and come back to it from the Campaigns list.

## Step 1: Recipients

Choose who the campaign goes to.

- **Audiences:** pick one or more audiences. Each option shows how many subscribers it has. At least one is required.
- **Exclude audiences:** optionally pick audiences whose subscribers should be left out.
- **Estimated recipients:** updates as you change the selection. It counts the unique contacts subscribed to at least one selected audience, minus those subscribed to an excluded audience.

Select **Continue** to save the recipients.

### Who actually receives the campaign

Emailit works out the final list when sending starts, not when you pick the audiences. A contact receives the campaign when:

1. It's subscribed to at least one of the selected audiences.
2. Its marketing status is **Subscribed**. Contacts unsubscribed with the **Unsubscribe** bulk action or `unsubscribed: true` are skipped.
3. Its address isn't on the [suppression list](/docs/suppressions/), with any suppression type that hasn't expired.

Each address receives one copy, even if it's in several selected audiences. People who join an audience after you schedule the campaign are included, and people who unsubscribe before sending starts are left out.

The estimate doesn't subtract globally unsubscribed contacts or suppressed addresses, so the number of emails sent can be lower than the estimate.

> **Excluded audiences aren't applied when sending:** Excluded audiences reduce the estimate, but the current version doesn't apply them when the campaign is sent. A contact who is in both a selected audience and an excluded audience still receives the campaign. Until this changes, don't rely on **Exclude audiences** to keep people out: remove them from the selected audiences, unsubscribe them, or send to an audience that doesn't include them.

## Step 2: Sender and Subject

| Field | Required | Notes |
| --- | --- | --- |
| **From name** | Yes | The name recipients see, for example `Acme`. |
| **From email** | Yes | An address on a domain verified in this workspace, for example `news@acme.com`. |
| **Subject** | Yes | Can include [merge tags](/docs/campaigns/merge-tags/), for example `October news for {{first_name}}`. |
| **Reply to** | No | Where replies go. Leave it empty to use the **From email**. |

Select **Continue** to save.

## Step 3: Content

Pick how you want to write the email:

| Option | Best for |
| --- | --- |
| **Dragit editor** | Designing a layout with drag-and-drop blocks. Saves automatically as you work. |
| **Rich-text editor** | Simple, text-first emails. Type `@` to insert a merge tag. |
| **HTML editor** | Pasting or writing your own HTML. |
| **Choose from templates** | Starting from one of your [templates](/docs/templates/). Emailit copies the template's content into the campaign, so later edits don't change the template. The template's subject isn't copied. |

See [Editors](/docs/templates/editors/) for how each editor works.

Once the campaign has content, the step shows a preview with these buttons:

- **Open editor** reopens the editor you used.
- **Remove content** clears the content so you can pick another editor. Switching editors always starts from empty content.
- **Save as template** saves the content, subject and sender as a new template you can reuse in other campaigns or send with the API. Enter a **Name** and an **Alias**, then select **Save** or **Save & Open**.

Add `{{unsubscribe_url}}` as a link in your content. In Dragit it's listed with the special links, and in the rich-text editor it's the **Unsubscribe URL** variable. See [Unsubscribes](/docs/audiences/unsubscribes/#the-link-in-your-content).

Select **Continue** when the content is ready.

## Step 4: Preview and test

- **Desktop** and **Mobile** show the email at each width.
- **Preview as contact** fills in the merge tags with a real contact's name, email and custom fields. Search for a contact by name or email.
- **Send test** sends the email to up to 5 addresses.

See [Test and schedule](/docs/campaigns/test-and-schedule/) for details and limits. Select **Continue** when you're happy with it.

## Step 5: Send

The last step summarizes the **From**, **Reply to**, **Subject**, **Recipients** and **Content**, with an **Edit** link back to each step, and runs these checks:

| Check | Result |
| --- | --- |
| **From**, **Subject**, **Content** | Must pass. **Send campaign** stays disabled until all three are set. |
| Unsubscribe link | "No problems detected!" when the HTML contains `{{unsubscribe_url}}`. Otherwise "Missing unsubscribe link!". This doesn't block sending, but fix it before you send. |
| Size | "Your content will be clipped as it is bigger than 100kb." appears when the HTML is larger than about 102 KB. Gmail cuts off longer messages and hides the rest, including the footer and unsubscribe link, behind a link. Shorten the content or move images and styles out of the HTML. |

Select **Send campaign**, then choose:

- **Immediately**, then **Send now**, to start sending right away.
- **Schedule**, then pick a date and time in **Schedule for**, in your computer's time zone, and select **Schedule**. The time must be in the future.

The campaign page opens and shows the campaign as **In process** or **Scheduled**. See [Test and schedule](/docs/campaigns/test-and-schedule/) for what happens next.

## Verify it worked

- The Campaigns list shows the campaign under **In process** or **Scheduled**, then **Sent**.
- The campaign page shows a **Send progress** bar while emails are created, then the delivery and engagement counts. See [Campaign reports](/docs/campaigns/reports/).
- Each recipient email appears under **Email API → Emails** with its own status.

## Create a campaign with the API

The same steps with the [Campaigns API](/docs/api-reference/campaigns/), using an API key with **Full Access**:

1. **Create the draft** with the sender, subject and HTML.

```bash
curl https://api.emailit.com/v2/campaigns \
  -X POST \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "October newsletter",
    "from_name": "Acme",
    "from_email": "news@acme.com",
    "reply_to": "support@acme.com",
    "subject": "October news for {{first_name}}",
    "html": "<p>Hi {{first_name}},</p><p>Here is what is new.</p><p><a href=\"{{unsubscribe_url}}\">Unsubscribe</a></p>",
    "text": "Hi {{first_name}}, here is what is new. Unsubscribe: {{unsubscribe_url}}"
  }'
```

   The response contains the campaign `id`, for example `cmp_4Tq9Xv2kLm8Rw`, with `status` `draft`.

2. **Set the recipients** with [Update a campaign](/docs/api-reference/campaigns/update/). `recipients` replaces the current list and needs at least one audience.

```bash
curl https://api.emailit.com/v2/campaigns/cmp_4Tq9Xv2kLm8Rw \
  -X POST \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "recipients": [{ "audience_id": "aud_5hJ2kL8mNp4Qr" }] }'
```

3. **Send it** with [Send or schedule a campaign](/docs/api-reference/campaigns/send/), or schedule it with `scheduled_at`. See [Test and schedule](/docs/campaigns/test-and-schedule/#use-the-api).

```bash
curl https://api.emailit.com/v2/campaigns/cmp_4Tq9Xv2kLm8Rw/send \
  -X POST \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

## Related

  - [Merge tags](/docs/campaigns/merge-tags/): Personalize the subject and content.
  - [Test and schedule](/docs/campaigns/test-and-schedule/): Test sends, scheduling and canceling.

---
Source: https://emailit.com/docs/campaigns/create/
