I need to attach a PDF file to the order confirmation email in Sylius.
So far I did it hacking the Sylius Core Bundle : in /Sylius/Bundle/CoreBundle/Mailer/TwigSwiftMailer.php I generate a PDF from a Twig template and my order informations (using Knp Snappy) and attach it to the email. It works fine, and I'd like to remove this from the Core Bundle and put it in my own bundles (so the Core Bundle could remain untouched).
But this process involves several services/event listeners, and I'm afraid I need to override all of them (i.e OrderConfirmationEmailListener.php, OrderConfirmationMailer.php, TwigSwiftMailer.php)...
Does anyone has a good lead / idea on how to achieve this plainly ?
Thanks