The EXM pipelines

Abstract

Understanding how the EXM pipelines and processors work gives you an insight into the message generation and sending process.

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

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.

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 relates to the email campaign (engagement plan, campaign, subject MV test) to Deployed.

PublishDispatchItems

Publishes the message item, message campaign item, and message engagement plan item.

QueueMessage

The master server queues recipients to a separate collection in the EXM dispatch database.

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.

SendMessage

The master server and the dedicated servers generate and send email campaigns.

The processor gets a contact from the EXM dispatch database. Each server 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.

For every recipient, the processor:

  • Assigns the appropriate automation state to the message.

  • Assigns the recipient – either the Sitecore user or the xDB contact.

  • Raises the subscriber:assigned event.

  • Requests the page that corresponds to the message.

  • Sets the user as the context user for the requested page. Security restrictions are applied.

  • Adds the “message opened” image.

  • Starts the SendEmail pipeline.

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.

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.

Note

If a NoSQL database becomes inaccessible during the dispatch, the dispatch is aborted, but the email campaign is moved to the Sent state anyway. To change this behavior, you can customize the MoveToSent processor.

If a SQL database becomes inaccessible during the dispatch, the dispatch is aborted. The MoveToSent processor does not change the state and the email campaign remains in the Paused state.

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

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 defined in the Sitecore.EmailExperience.ContentManagement.config file.

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).

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:

  • 200 on the primary CM server. The server pauses for 200 ms after sending each email message.

  • 50 on the dedicated server. The server pauses for 50 ms after sending each email message.

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%).