---
title: "Sequences"
description: "Automated multi-step follow-ups that stop when a contact replies."
source: "https://www.mailmark.dev/docs/sequences"
site: "Mailmark"
---

# Sequences

Automate multi-step email follow-up campaigns that send the right message at the right time.

## What are sequences?

A sequence is an ordered list of email steps and time delays. Once a contact is enrolled, Mailmark sends each email step automatically, waiting the configured delay before moving on to the next one.

Common use cases:

- Cold outreach with automatic follow-ups if there is no reply
- Onboarding drips that guide new users through your product
- Re-engagement campaigns for inactive contacts
- Post-purchase follow-up and upsell flows

Unlike a one-off campaign, sequences are contact-centric: each enrolled contact progresses through the steps at their own pace. If a contact replies, the enrollment is marked as replied and no further steps are sent.

## Creating a sequence

Sequences are created from the Mailbox view. Open any mailbox, navigate to the Sequences tab, and click New Sequence.

A sequence is built from two types of steps:

| Type | Purpose | Required fields |
| ---- | ------- | --------------- |
| send_email | Send an email to the enrolled contact | subject, html body |
| delay | Wait before running the next step | delayMs (milliseconds) |

The first step of every sequence must be a `send_email` step. You cannot start a sequence with a delay.

Example sequence structure:

```text
Step 1: send_email  -- Initial outreach (sent immediately on enrollment)
Step 2: delay       -- Wait 3 days  (3 * 24 * 60 * 60 * 1000 ms)
Step 3: send_email  -- First follow-up
Step 4: delay       -- Wait 5 days
Step 5: send_email  -- Second follow-up (final)
```

You can add as many alternating send/delay steps as needed. There is no hard limit on sequence length.

## Enrolling contacts

After creating a sequence, enroll contacts one at a time or in bulk via CSV import from the Sequences tab. Via the API: `POST https://api.mailmark.dev/v1/sequences/{id}/enroll` (max 100 contacts per request).

Enrollment rules:

- A contact can only be enrolled in the same sequence once at a time. Enrolling a contact already in `active` status returns an error.
- A contact who previously completed or was cancelled from a sequence can be re-enrolled.
- Enrollment starts immediately: the first `send_email` step is scheduled as soon as the contact is enrolled.

Enrollment statuses:

| Status | Meaning |
| ------ | ------- |
| active | Contact is progressing through the sequence |
| completed | All steps have been sent successfully |
| replied | Contact replied to one of the sequence emails |
| cancelled | Manually removed from the sequence |
| bounced | An email step bounced; sequence stopped for this contact |

## Merge fields

Personalise sequence emails with contact-specific data by passing merge fields at enrollment time. Merge fields are arbitrary key-value pairs interpolated into the email subject and body when each step runs.

```text
Subject: Hey {{firstName}}, quick question
Body:
<p>Hi {{firstName}},</p>
<p>I noticed {{company}} recently expanded into {{market}}.</p>
<p>We help companies like yours with email deliverability...</p>
```

Supply the values when enrolling the contact. Any key used in the template must be present in the merge fields object, otherwise the placeholder is left as-is.

```json
{
  "contactEmail": "alice@acme.com",
  "mergeFields": {
    "firstName": "Alice",
    "company": "Acme Corp",
    "market": "Southeast Asia"
  }
}
```

Merge fields are stored per enrollment and applied at the time each step runs, so every recipient of a bulk-enrolled sequence gets their own personalised version of the email.

## Managing sequences

| Status | Effect |
| ------ | ------ |
| active | New contacts can be enrolled; scheduled steps continue to send. |
| paused | No new steps are sent. Existing scheduled jobs are held until resumed. |
| completed | Sequence is archived. No new enrollments allowed. |

Pausing a sequence prevents pending steps from firing. When you resume, scheduled steps continue from where they left off; contacts do not restart from the beginning.

Marking a sequence as completed immediately cancels all active enrollments. This cannot be undone.

Step content (subject, body) can be edited while a sequence is active. Changes apply to future step runs only. Pausing the sequence before significant edits is recommended.

## Next steps

- [Email Campaigns](/docs/email-campaigns) - send one-off bulk campaigns to a list of recipients.
- [API Reference](/docs/api) - integrate sequences and sending into your own application.

---

Mailmark - email hosting and campaigns for your own domain. Canonical page: https://www.mailmark.dev/docs/sequences | [llms.txt](https://www.mailmark.dev/llms.txt) | [OpenAPI](https://www.mailmark.dev/openapi.json) | [sitemap](https://www.mailmark.dev/sitemap.xml)
