Description
In this Sylius Academy episode, we explore two practical ways to customize existing emails in Sylius. Whether you're looking to disable a built-in message or personalize its content, Sylius offers flexible options based on real business needs.
You’ll learn:
- How to disable a built-in email (shipment confirmation):
Useful when an external system already handles shipment notifications.
- Set enabled: false for shipment_confirmation in emails.yaml.
- Confirm the email is no longer sent during order processing.
- How to personalize the order confirmation email:
Show recommended products for customers who agreed to receive marketing communication.
- Override OrderEmailManager and inject ProductRepository.
- Fetch channel-specific latest products using findLatestByChannel() based on order's locale and channel.
- Register the customized service in services.yaml.
- Extend the Twig template order_confirmation/content.html.twig to display 4 latest products with names, images, and links.
Both examples demonstrate how Sylius can be adapted to your email strategy, using service overrides, templates, and dynamic content rendering.