---
title: "The EXM pipelines"
slug: "the-exm-pipelines"
abstract: "Understanding how the EXM pipelines and processors work gives you an insight into the message generation and sending process."
---
# The EXM pipelines

The Email Experience Manager uses two main pipelines to generate and send messages:

- [DispatchNewsletter pipeline](https://doc.sitecore.com/xp/en/developers/exm/91/email-experience-manager/the-exm-pipelines.html#UUID-82d5dce3-d35d-f72a-f4e7-3843c21c460a_id__DispatchNewsletter_pipeline "DispatchNewsletter pipeline")
- [SendEmail pipeline](https://doc.sitecore.com/xp/en/developers/exm/91/email-experience-manager/the-exm-pipelines.html#UUID-82d5dce3-d35d-f72a-f4e7-3843c21c460a_id__SendEmail_Pipeline "DispatchNewsletter pipeline for dedicated servers")

The pipelines are defined in the EXM configuration files. You can extend and customize the pipelines by adding custom processors or replacing the default ones.

Understanding how the EXM pipelines – and the processors that they include – work gives you an insight into the whole message generation and sending process. Different message types may require the utilization of different processors.

<details>
<summary><h2>DispatchNewsletter pipeline</h2></summary>

The `DispatchNewsletter` pipeline is defined in the `Sitecore.EmailExperience.ContentManagementPrimary.config` file. This pipeline includes the following processors:

| Processor name | Description |
| --- | --- |
| `CheckPreconditions` | Checks whether all the conditions required to start sending the email campaign are met. |
| `MoveToQueuing` | Moves the email campaign to the Queuing state. |
| `DeployAnalytics` | Changes the workflow state of the analytics definitions that are related to the email campaign (campaign, subject MV test) to Deployed. |
| `PublishDispatchItems` | Publishes the message item and the message campaign item. |
| `QueueMessage` | The master server queues recipients to the DispatchQueue table in the EXM master database, using segmented List Manager contact sources to filter out contacts where:<br><br><ul><li>communication consent has been revoked</li><li>do not market has been set</li><li>the bounce count has exceeded the maximum allowed</li></ul> |
| `MoveToProcessing` | Changes the state of the email campaign to Sending. |
| `LaunchDedicatedServers` | The master server launches the `DispatchNewsletter` pipeline on the dedicated servers. This is a simplified version of the pipeline and does not include processors that are only appropriate for the master server. The master server and the dedicated servers share the same databases. |
| `SendTestMessage` | The master server is used to send out quick tests |
| `SendMessage` | The master server and the dedicated servers generate and send email campaigns.<br><br>The processor gets multiple contacts from the EXM dispatch database. You can specify the number of contacts in the `EXM.DispatchBatchSize` setting in the Sitecore.EmailExperience.ContentManagement.config file.<br><br>Each server then accesses the list of recipients and takes one of the remaining recipients to generate the email campaign for. The process continues as long as there are recipients left in the list.<br><br>For every recipient, the processor:<br><br><ul><li>Raises the `subscriber:assigned` event.</li><li>Requests the page that corresponds to the message.</li><li>Sets the user as the context user for the requested page. Security restrictions are applied.</li><li>Adds the “message opened” image.</li><li>Starts the `SendEmail` pipeline.</li></ul> |
| `WaitForDispatchToFinish` | If you have configured at least one dedicated dispatch server and you want to disable dispatch on the master server, you must enable this pipeline processor and disable the SendMessage pipeline processor.<br><br>You enable and disable the pipeline processors by commenting them in/out. This processor is by default disabled. |
| `MoveToSent` | Changes the state of the email campaign to Sent. |
| `NotifyDispatchFinished` | Sends the notification when the dispatch process is finished. |
| `FinalizeDispatch` | Cleans up the internal variables of the round-robin MV test process and closes the remaining connections to the SMTP server. |

### DispatchNewsletter pipeline for dedicated servers

A simplified version of the `DispatchNewsletter` pipeline that is tailored for dedicated dispatch servers is defined in the `Sitecore.EmailExperience.EmailProcessing.config` file. This version of the pipeline only includes the following processors:

- `CheckPreconditions`
- `SendMessage`
- `FinalizeDispatch`

</details>

<details>
<summary><h2>SendEmail Pipeline</h2></summary>

The `SendMessage` processor starts the `SendEmail` pipeline for every email message to be sent.

The `SendEmail` pipeline is defined in the `Sitecore.EmailExperience.ContentManagement.config` file. This pipeline includes the following processors:

| **Processor name** | **Description** |
| --- | --- |
| `FillEmail` | Generates the message using the personalized recipient data. |
| `SendEmail` | Sends the email campaign to the MTA. |
| `CreateTask` | Creates a task that adds an interaction with the Email Sent page event. |
| `Sleep` | Controls for how long EXM pauses on the current server after sending each email message. Specified in milliseconds (ms).<br><br>In a multiserver setup, you can use this processor to balance the load between the servers. For example, if you want the dedicated server to send 4 times as many email messages as the primary CM server, specify the following values on the sleep setting:<br><br><ul><li>200 on the primary CM server. The server pauses for 200 ms after sending each email message.</li><li>50 on the dedicated server. The server pauses for 50 ms after sending each email message.</li></ul><br><br>Then, if you send 1000 email messages, the primary CM server sends approximately 200 email messages (20%) and the dedicated server sends approximately 800 emails (80%). |

</details>