How to send a custom e-mail?
1. Create the Email Template
{# templates/email/out_of_stock.html.twig #}
{% extends '@SyliusCore/Email/layout.html.twig' %}
{% block subject %}
One of your products is out of stock.
{% endblock %}
{% block content %}
<div style="text-align: center; margin-bottom: 30px;">
The variant
<div style="margin: 10px 0;">
<span style="border: 1px solid #eee; padding: 10px; color: #1abb9c; font-size: 28px;">
{% if variant.name %}
{{ variant.name }}
{% else %}
{{ variant.product.name }}
{% endif %}
</span>
</div>
is currently out of stock.
</div>
{% endblock %}2. Register the Email in Mailer Configuration
3. Create a Custom Email Manager
4. Register the Service
5. Create a callback for order_payment
Create the Event Listener
Register the Listener
✅ Test the Results
1. Create a product with tracked stock

2. Place an Order


3. Verify Email Sent

PreviousHow to disable the order confirmation email?NextHow to customize email templates per channel?
Last updated
Was this helpful?
