Make Mime\BodyRenderer
markdown conversion configurable
#46295
Labels
Mime\BodyRenderer
markdown conversion configurable
#46295
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 theBodyRenderer
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
toMyBodyRenderer
, modify it and try to keep up with the changes in Symfony)I suggest that the
League\HTMLToMarkdown\HtmlConverter
is wrapped behind someHtmlToTextConverter
interface, so it would be possible to either replace it with other convertor or at least configure it differently.The text was updated successfully, but these errors were encountered: