---
title: Manage multiple email channels
related:
  - https://docs.kentico.com/documentation/developers-and-admins/digital-marketing-setup/email-channel-management.md
  - https://docs.kentico.com/documentation/business-users/digital-marketing/emails.md
  - https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder.md
  - https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder/develop-email-builder-components.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Having multiple email channels within a single Xperience by Kentico application provides flexibility in how you communicate with your audiences. You can use different sending domains for each channel, which makes it easier to tailor communication to specific regions, brands, or customer segments. Multiple channels also let you distribute different language variants of emails, which a single channel doesn't support.

This page provides best practices for **organizing the code of multiple email channels within one Xperience project**.

The required level of code separation depends on the [content model](https://docs.kentico.com/guides/architecture/content-modeling/content-modeling-guide.md) each channel uses. In most cases, you’ll want to treat them as independent, with separate [content types](https://docs.kentico.com/documentation/developers-and-admins/development/content-types.md) and [Email Builder components](https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder/develop-email-builder-components.md) for each channel. However, if your email channels share an identical content model, you can often treat them as a single channel and reuse your code without any issues.

To implement multiple email channels:

1. [Create and configure your email channels](https://docs.kentico.com/documentation/developers-and-admins/digital-marketing-setup/email-channel-management.md) in the administration interface.
2. Organize the project structure and content types according to the recommendations below.

## Content types

Use a unique namespace in the code name of [content types](https://docs.kentico.com/documentation/developers-and-admins/development/content-types.md) related to a specific email channel. This prevents conflicts when implementing various features related to content types.

### Generated email model classes

For smaller projects, you may store your [generated email model classes](https://docs.kentico.com/documentation/developers-and-admins/api/generate-code-files-for-system-objects.md) directly in the main Xperience project.

For larger solutions, where Email Builder components may be placed in dedicated [Razor class libraries](https://learn.microsoft.com/en-us/aspnet/core/razor-pages/ui-class) (RCLs), the model classes must also be available to those RCLs. In this case, we recommend storing your generated email classes in a dedicated _Class library_ project for all generated model classes and reference it from the main Xperience project as well as from any Email Builder RCLs.

## Email Builder

Use [Razor class libraries](https://learn.microsoft.com/en-us/aspnet/core/razor-pages/ui-class) (RCLs) to organize the code of your [Email Builder](https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder.md) components if you plan to create a large number of Email Builder components. For smaller projects you can store your components directly within the main Xperience project. Your components can be shared depending on your implementation.

We recommend structuring your solution with separate projects for each channel, as well as an optional shared library for components shared across your channels:

- **AcmeEmail** – RCL for the _Acme_ email channel
- **DancingGoatEmail** – RCL for the _Dancing Goat_ email channel
- **Shared** – optional RCL for [Email Builder components](https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder/develop-email-builder-components.md) common to multiple channels
- **Xperience** – the main web application project containing startup code, system data, and configuration. For example:
  - Startup and general system configuration (could be based on the Xperience _Boilerplate_ [project template](https://docs.kentico.com/documentation/developers-and-admins/installation.md))
  - Binary data of [content item assets](https://docs.kentico.com/documentation/business-users/content-hub/content-item-assets.md)

### Widgets and sections

- Store the code of general components in a shared location. Components specific to an email channel can be stored in a corresponding RCL.
- Restrict widgets and sections using the `AllowedWidgets` and `AllowedSections` properties of the `EditableArea` razor component used to [define editable areas](https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder/develop-email-builder-components.md#editable-areas) in email templates.

### Email templates

- Store [email templates](https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder/develop-email-builder-components.md#templates) for each email channel in their corresponding RCL, e.g., _/EmailTemplates_.
- Scope email templates to certain content types using the `ContentTypeNames` parameter of the [registration attribute](https://docs.kentico.com/documentation/developers-and-admins/development/builders/email-builder/develop-email-builder-components.md#register-templates).
