Using Sitecore ECM to Send Emails to Dynamic Users

Triggered Email Messages is something new that was introduced in v2.0 of the Email Campaign Manager (ECM).

Triggered messages are messages that are sent to a single person at a time, when triggered by a specific event or in a specific flow. For example, this could be sending a message to user when they register for a website, or to a user who visited the website once but has not returned for three weeks.

Unlike subscription messages and one time messages, triggered messages do not have a fixed or defined number of recipients, since the module knows the recipient only when an events or a condition is triggered by that recipient.

It turns out that triggered email messages are the answer to a problem that I struggled with for a long time in Sitecore. For the longest time I could not find a good solution that gave content authors the ability to create and manage one-off emails in Sitecore (Ex: Sending a follow up email after a visitor registered for a site). In the past the real problem was that the ECM did not have a way of sending emails to dynamic users. Instead the ECM would allow you to send emails to predetermined lists of users but not to a single user on the fly (who we don’t even have yet).

Unfortunately that meant that I was not able to take advantage of all the nice features that come with ECM like a nice GUI interface for creating emails and all the reporting and tracking functionality. Instead I resorted to much uglier methods that did not result in great experiences for content authors.

The new addition of Triggered Email Messages is the perfect solution to the problem I outlined above. You are now able to dynamically reference and send an ECM email to a specific user directly from your code. What this means is that your content authors will be able to manage one-off emails in ECM which provides a very intuitive GUI and gives them access to the full suite of tracking and reporting features available in ECM.

The ECM documentation shows that you are able to send Triggered email messages using the sample code below.

public void Send(ID messageItemId, string userName)
{
    MessageItem message = Sitecore.Modules.EmailCampaign.Factory.GetMessage(messageItemId);
    Contact contactFromName = Contact.FromName(userName);
    new AsyncSendingManager(message).SendStandardMessage(contactFromName);
}
Advertisements
Posted in Sitecore

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s