@@ -717,12 +717,22 @@ method of the ``TemplatedEmail`` class and also to a special variable called
717717Text Content
718718~~~~~~~~~~~~
719719
720- When the text content of a ``TemplatedEmail `` is not explicitly defined, mailer
721- will generate it automatically by converting the HTML contents into text. If you
722- have `league/html-to-markdown `_ installed in your application,
723- it uses that to turn HTML into Markdown (so the text email has some visual appeal).
724- Otherwise, it applies the :phpfunction: `strip_tags ` PHP function to the original
725- HTML contents.
720+ When the text content of a ``TemplatedEmail `` is not explicitly defined, it is
721+ automatically generated from the HTML contents.
722+
723+ Symfony uses the following strategy when generating the text version of an
724+ email:
725+
726+ * If an explicit HTML to text converter has been configured (see
727+ :ref: `twig.mailer.html_to_text_converter
728+ <config-twig-html-to-text-converter>`), it calls it;
729+
730+ * If not, and if you have `league/html-to-markdown `_ installed in your
731+ application, it uses it to turn HTML into Markdown (so the text email has
732+ some visual appeal);
733+
734+ * Otherwise, it applies the :phpfunction: `strip_tags ` PHP function to the
735+ original HTML contents.
726736
727737If you want to define the text content yourself, use the ``text() `` method
728738explained in the previous sections or the ``textTemplate() `` method provided by
@@ -732,13 +742,13 @@ the ``TemplatedEmail`` class:
732742
733743 + use Symfony\Bridge\Twig\Mime\TemplatedEmail;
734744
735- $email = (new TemplatedEmail())
736- // ...
745+ $email = (new TemplatedEmail())
746+ // ...
737747
738- ->htmlTemplate('emails/signup.html.twig')
748+ ->htmlTemplate('emails/signup.html.twig')
739749 + ->textTemplate('emails/signup.txt.twig')
740- // ...
741- ;
750+ // ...
751+ ;
742752
743753 .. _mailer-twig-embedding-images :
744754
0 commit comments