How to customize email templates per channel?
Letβs assume you have two channels in your Sylius store: TOY_STORE
and FASHION_WEB
. You want to personalize email content depending on which channel the customer used to place an order. This guide shows how to achieve this in a maintainable and scalable way.
To verify and manage channels in your system, open the Channels grid in the Sylius admin panel. Youβll find each channelβs code, name, and hostname.

These codes are what you will use to differentiate content in your Twig templates.
2. Identify the Email Template to Override
You can find a full list of templates and context variables in the emails documentation.
Original template path:
@SyliusCoreBundle/Email/orderConfirmation.html.twig
To override it, copy it to:
templates/bundles/SyliusCoreBundle/Email/orderConfirmation.html.twig
3. Use if
Statements for Simple Channel Variations
if
Statements for Simple Channel VariationsFor minor differences between channels, use if
conditions in the Twig template:
{# templates/bundles/SyliusCoreBundle/Email/orderConfirmation.html.twig #}
{% extends '@SyliusCore/Email/layout.html.twig' %}
{% block subject %}
{% include '@SyliusCore/Email/Blocks/OrderConfirmation/_subject.html.twig' %}
{% endblock %}
{% block content %}
{% if sylius.channel.code == 'TOY_STORE' %}
Thanks for buying one of our toys!
{% elseif sylius.channel.code == 'FASHION_WEB' %}
Your new style is on the way!
{% else %}
Thanks for your purchase!
{% endif %}
Your order no. {{ order.number }} has been successfully placed.
{% endblock %}
Best for 2β3 channels that have cosmetic differences.
4. Extract Channel-Specific Templates for Maintainability (Recommended)
Instead of using many if
statements, extract logic into per-channel files:
Parent Template:
{# templates/bundles/SyliusCoreBundle/Email/orderConfirmation.html.twig #}
{% extends '@SyliusCore/Email/layout.html.twig' %}
{% block subject %}
{% include '@SyliusCore/Email/Blocks/OrderConfirmation/_subject.html.twig' %}
{% endblock %}
{% block content %}
{% include [
'Email/OrderConfirmation/' ~ sylius.channel.code ~ '.html.twig',
'Email/OrderConfirmation/_default.html.twig'
] %}
{% endblock %}
Example File Structure
templates/
βββ bundles/
β βββ SyliusShopBundle/
β βββ Email/
β βββ orderConfirmation.html.twig
βββ Email/
βββ OrderConfirmation/
βββ TOY_STORE.html.twig
βββ FASHION_WEB.html.twig
βββ _default.html.twig
Sample Channel Files
_default.html.twig
{# templates/Email/OrderConfirmation/_default.html.twig #}
Your order no. {{ order.number }} has been successfully placed.
TOY_STORE.html.twig
{# templates/Email/OrderConfirmation/TOY_STORE.html.twig #}
Thanks for buying one of our toys!
Your order with number {{ order.number }} is currently being processed.
FASHION_WEB.html.twig
{# templates/Email/OrderConfirmation/FASHION_WEB.html.twig #}
Your new style is on the way!
Weβve received your order no. {{ order.number }}.
This structure allows you to extend or localize emails without changing the parent layout.
5. Understand the Default Layout
By default, the core Sylius orderConfirmation.html.twig
email looks like this:
{# SyliusCoreBundle/Resources/views/Email/orderConfirmation.html.twig #}
{% extends '@SyliusCore/Email/layout.html.twig' %}
{% block subject %}
{% include '@SyliusCore/Email/Blocks/OrderConfirmation/_subject.html.twig' %}
{% endblock %}
{% block content %}
{% include '@SyliusCore/Email/Blocks/OrderConfirmation/_content.html.twig' %}
{% endblock %}
_subject.html.twig
: contains the translated subject line_content.html.twig
: includes layout, order number, and optional link
You can override any of these includes or the layout itself per channel as needed.
6. Summary: Strategy by Complexity
Scenario
Strategy
1β2 channels, small changes
Use {% if %}
blocks in one template
3+ channels, or different voice
Use include
with fallback per channel
β
Result
Each email adapts to the right channel automatically. Developers can manage templates independently, and fallback logic ensures robustness.
Youβve now implemented clean, scalable multi-channel email templates in Sylius!


Last updated
Was this helpful?