- [Home page](https://www.brimit.com/)
- [Blog](https://www.brimit.com/blog)

# Sitecore DXP: E-Commerce Transactional Emails with Sitecore Send and OrderCloud

[Tech Talks](https://www.brimit.com/blog?categories=Tech%20Talks) [DXP](https://www.brimit.com/blog?platforms=DXP)
[Igor Zharikov](https://www.brimit.com/blog/author?authors=Igor%20Zharikov) on September 11, 2024

![Sitecore Send](https://www.brimit.com/-/jssmedia/images/blog/sitecore-send-apis/sendlogo.png?h=400&iar=0&w=660&hash=1A34554FB4C322BA3D6ACC239404FCB1)

#### About Transactional Emails

Transactional emails are one-to-one emails that contain information completing a transaction or process the recipient has initiated. When a customer performs an action on your website, you notify them about it by sending an email.

Here are a few examples of transactional campaigns:

- User registration
- Password reset
- Order confirmation
- Order shipped
- Order delivered
- OTP email verification

#### Transactional Emails in Sitecore DXP (Sitecore Send)

For sending emails in Sitecore DXP, we can use one of its products: [Sitecore Send](https://developers.sitecore.com/marketing-automation/send).

Sitecore Send is a cloud-based, AI-powered email marketing solution that allows you to target your audience at scale.

There are **two options** to send transactional emails using Sitecore Send:

- [SMTP](https://doc.sitecore.com/send/en/users/sitecore-send/use-smtp-to-send-transactional-emails.html) - a clear and well-known option for sending emails. We will utilize this option in the solution.
- [Transactional Campaigns](https://doc.sitecore.com/send/en/users/sitecore-send/create-a-transactional-campaign.html) - a new feature from Sitecore Send that provides the ability to use dynamic tokens and design transactional emails directly within Send. More information is available in the [documentation](https://doc.sitecore.com/send/en/developers/api-documentation/create-a-transactional-campaign.html).

A comparison between these two options is shown in the table below:

| *Feature* | **SMTP** | **Transactional Campaigns** |
| --- | --- | --- |
| Email Design in Send | No ^[1]^ | Yes |
| Render Email Yourself | Always | Optional ^[2]^ |
| HTML-Ready Email Support | Yes | Yes |
| Email Body by URL | No | Yes |
| Attachments | No | Yes |
| Bypass Unsubscribed | Yes ^[3]^ | Yes |

*Notes*:

- [1] - Email design can be done with Mustache. For example, see [this article](https://www.brimit.com/blog/sitecore-send-5-dynamic-transactional-emails), but you'll still need to render the email HTML elsewhere.
- [2] - In transactional campaigns, you can send an HTML email, specify a URL for your email template, or use an email designed in Send.
- [3] - *Bypass Unsubscribed* means that even if a subscriber has unsubscribed from transactional campaigns, the email will still be sent. With SMTP, this can be done using the API, while it is included out-of-the-box in the Transactional API.

Overall, you can see that transactional campaigns are a more powerful tool for sending transactional emails, but it is quite new and was not available when we started the implementation.

#### OrderCloud Integration Point

The best way to integrate OrderCloud to send transactional emails is to use [Message Senders](https://ordercloud.io/knowledge-base/message-senders).

>
>
> **Message Senders** is a feature that helps deliver event-driven notifications to users based on certain key commerce activities.
>

This definition intersects with the definition of transactional emails, so Message Senders are designed for transactional emails or similar types of notifications.

Currently, there's no built-in integration, but you can use the *Custom URL* option to configure a **custom endpoint** (similar to a webhook) to handle events when an email should be sent.

The endpoint can be placed in any custom web service, but we use a [middleware-based project](https://ordercloud.io/knowledge-base/start-dotnet-middleware-from-scratch) from OrderCloud.

![OrderCloud message sender config](https://www.brimit.com/-/media/images/blog/sitecore-send-transactional-emails/order-cloud-config.png)

#### Sitecore Send SMTP

To send emails, [Send SMTP](https://doc.sitecore.com/send/en/users/sitecore-send/use-smtp-to-send-transactional-emails.html) can be used. Sending the email via SMTP varies by language, but for C#, [`SmtpClient`](https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=net-8.0) is the best way.

#### Full Architecture

The full architecture looks as follows:

![Sitecore DXP transactional emails architecture](https://www.brimit.com/-/media/images/blog/sitecore-send-transactional-emails/email-architecture.png)

We use [Azure Service Bus](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview) together with [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview?pivots=programming-language-csharp) for better message handling, to make the process of sending emails more asynchronous and decoupled.

I discussed this in more detail at the [Sitecore User Group Poland](https://www.youtube.com/watch?v=esKMTw6NGo8) and SUG Belarus. Please check the recordings for more details.

And of course, share your thoughts and questions with me.

###### Author

![Igor Zharikov - Senior Sitecore Developer, Sitecore MVP](https://www.brimit.com/-/jssmedia/feature/blogs/authors/igor-zharikov-2.jpg?h=700&iar=0&w=700&hash=292A84E8CB3E5CE57CA743385CFB1464)

Igor Zharikov

Sitecore MVP / Senior Sitecore Developer
[Igor Zharikov](https://www.brimit.com/blog/author?authors=Igor%20Zharikov)

###### More By Categories

[#Events](https://www.brimit.com/blog?categories=#Events) [#How-to](https://www.brimit.com/blog?categories=#How-to) [#News](https://www.brimit.com/blog?categories=#News) [#Guides](https://www.brimit.com/blog?categories=#Guides)

###### More by Platform

[Data and AI](https://www.brimit.com/blog?platforms=Data%20and%20AI) [DXP](https://www.brimit.com/blog?platforms=DXP) [E-commerce](https://www.brimit.com/blog?platforms=E-commerce) [Internet of Things](https://www.brimit.com/blog?platforms=Internet%20of%20Things) [Sales and marketing automation](https://www.brimit.com/blog?platforms=Sales%20and%20marketing%20automation)
