Custom mail templates
Customizing Sylius Email Templates for Frontend Links
eBy default, Sylius 2.0 email templates generate backend URLs (e.g. /admin/...) that don't make sense for a headless frontend setup like FrontWing.
To fix this, you need to override the Twig templates and point them to the correct frontend routes.
This page shows examples for 3 templates, but the approach is identical for others (shipping updates, invoice, newsletter, etc.).

Account Verification Email
File to override:
Example content:
Password Reset Email
File to override:
Example content:
Order Confirmation Email
File to override:
Example content:
🛠 Tips
Replace all hardcoded URLs with your own domain.
Use inline styles for better email client compatibility.
You can customize any email Sylius sends — just look in the
/views/Email/folder and follow the same pattern.
Local email testing
During development, it's important to test email templates locally. Sylius uses the configured mailer transport from .env or .env.local.
To use MailHog:
Install and run MailHog (e.g. via Docker or Homebrew).
Update your
.env.localin the Sylius backend:
Start your server and open http://localhost:8025 to view sent emails.
You can also use other tools like Mailtrap or Symfony Mailer’s file transport.
Last updated
Was this helpful?
