Allow manipulating mail data with MailBeforeSentEvent
Currently, MailBeforeSentEvent has no setter methods to manipulate mail data.
The Symfony documentation describes such an event where one could update subject and message properties: https://symfony.com/doc/current/event_dispatcher.html#how-to-customize-a-method-behavior-without-using-inheritance
My use case is that I want to edit the mail contents. For that, I need to adjust the return value of the private method "buildContents". That seems not possible with a decorator.
A workaround is to completely replace the core MailService class:
<service id="Shopware\Core\Content\Mail\Service\MailService" class="MyPlugin\Service\MailService">
...
</service>
That, however, will lead to breaking changes if the MailService class gets patched in the future.