Description
Description
Symfony can already automatically generate a text version of an e-mail in \Symfony\Bridge\Twig\Mime\BodyRenderer
using league/html-to-markdown (see https://symfony.com/doc/current/mailer.html#text-content)
But there is no way to configure the conversion options (e.g. we would like to remove the img
tags as well). The instantiation is hardcoded in the constructor and the BodyRenderer
itself is marked as final:
symfony/src/Symfony/Bridge/Twig/Mime/BodyRenderer.php
Lines 23 to 37 in 1ac98fc
(The only way I see as an extension option is to copy the
BodyRenderer
to MyBodyRenderer
, modify it and try to keep up with the changes in Symfony)
I suggest that the League\HTMLToMarkdown\HtmlConverter
is wrapped behind some HtmlToTextConverter
interface, so it would be possible to either replace it with other convertor or at least configure it differently.