In march 2024 we left swiftmailer and switched to symfony-mailer-lite.
Everything looked well until we found that the font for mails which had no template specified in our theme had a default font like times new roman instead of arial.
We then took the mail template from the old swiftmailer and put it in our theme thought this will fix it.
It did fix it for the font but not for the formatting. Before any Element title was bold and styled in the mails now only plain text.
So now I wonder if there is something else we missed.
Here are two mails, the first is from february and contains all the style info. The second is from now.
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
table tr td {
font-family: Arial;
font-size: 12px;
}
</style>
</head>
<body>
<div>
<table width="800px" cellpadding="0" cellspacing="0">
<tr>
<td>
<div style="padding: 0px 0px 0px 0px;">
<p>Gesendet am: Fr., 26.04.2024 - 19:35</p>
<p>Gesendet von: admin</p>
<p>Gesendete Eingaben:</p>
<b>Anrede</b><br>Familie<br><br><b>Vorname</b><br>Dixisset<br><br><b>Nachname</b><br>Loremipsum<br><br><b>Straße</b><br>Dixisset<br><br><b>Hausnummer</b><br>Oratione<br><br><b>PLZ</b><br>Loremipsum<br><br><b>Ort</b><br>Loremipsum<br><br><b>E-Mail</b><br><a href="mailto:test@test.com">test@test.com</a><br><br><b>Telefonnummer</b><br>Oratione<br><br><b>Betreff</b><br>Loremipsum<br><br><b>Ihr Anliegen</b><br>Quae cum dixisset, finem ille. Quamquam non negatis nos intellegere quid sit voluptas, sed quid ille dicat. Progredientibus autem aetatibus sensim tardeve potius quasi nosmet ipsos cognoscimus. Gloriosa ostentatio in constituendo summo bono. Qui-vere falsone, quaerere mittimus-dicitur oculis se privasse; Duarum enim vitarum nobis erunt instituta capienda. Comprehensum, quod cognitum non habet? Qui enim existimabit posse se miserum esse beatus non erit. Causa autem fuit huc veniendi ut quosdam hinc libros promerem. Nunc omni virtuti vitium contrario nomine opponitur.<br><br><b>Weitergabe von personenbezogenen Daten</b><br>Ich bin nicht damit einverstanden, dass meine in diesem Formular erhobenen personenbezogenen Daten zum Zweck der Beantwortung meiner Anfrage an andere Behörden der Landesverwaltung, Bundes- oder kommunale Behörden weitergeleitet werden. Wir weisen vorsorglich darauf hin, dass Ihre Anfrage u. U. nicht beantwortet werden kann, wenn Sie hiermit nicht einverstanden sind.<br><br>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
The current one:
<!-- THEME DEBUG --><!-- THEME HOOK: 'symfony_mailer_lite_email' --><!-- FILE NAME SUGGESTIONS:
* symfony-mailer-lite-email--webform--kontakt-e-mail.html.twig
* symfony-mailer-lite-email--webform.html.twig
x symfony-mailer-lite-email.html.twig
--><!-- BEGIN OUTPUT from 'themes/custom/hw_radix_standard/templates/mail/symfony-mailer-lite-email.html.twig' --><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
table tr td {
font-family: Arial;
font-size: 12px;
}
</style>
</head>
<body>
<div flags="63">
<table width="800px" cellpadding="0" cellspacing="0">
<tr>
<td>
<div style="padding: 0px 0px 0px 0px;">
<b>symfony-mailer-lite-email</b>
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'webform_email_message_html' -->
<!-- FILE NAME SUGGESTIONS:
* webform-email-message-html--kontakt--email--e-mail.html.twig
* webform-email-message-html--kontakt--email.html.twig
* webform-email-message-html--kontakt.html.twig
x webform-email-message-html.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/webform/templates/webform-email-message-html.html.twig' -->
<b>webform-email-message-html</b>
<p>Gesendet am: Fr., 26.04.2024 - 13:44</p>
<p>Gesendet von: admin</p>
<p>Gesendete Eingaben:</p>
<p> Anrede<br>Frau</p>
<p> Vorname<br>Dixisset</p>
<p> Nachname<br>Dixisset</p>
<p> Straße<br>Oratione</p>
<p> Hausnummer<br>Oratione</p>
<p> PLZ<br>Oratione</p>
<p> Ort<br>Loremipsum</p>
<p> E-Mail<br><a href="mailto:test@test.com">test@test.com</a></p>
<p> Telefonnummer<br>Oratione</p>
<p> Betreff<br>Loremipsum</p>
<p> Ihr Anliegen<br>Quae cum dixisset, finem ille. Quamquam non negatis nos intellegere quid sit voluptas, sed quid ille dicat. Progredientibus autem aetatibus sensim tardeve potius quasi nosmet ipsos cognoscimus. Gloriosa ostentatio in constituendo summo bono. Qui-vere falsone, quaerere mittimus-dicitur oculis se privasse; Duarum enim vitarum nobis erunt instituta capienda. Comprehensum, quod cognitum non habet? Qui enim existimabit posse se miserum esse beatus non erit. Causa autem fuit huc veniendi ut quosdam hinc libros promerem. Nunc omni virtuti vitium contrario nomine opponitur.</p>
<p> Weitergabe von personenbezogenen Daten<br>Ich bin damit einverstanden, dass meine in diesem Formular erhobenen personenbezogenen Daten zum Zweck der Beantwortung meiner Anfrage an andere Behörden der Landesverwaltung, Bundes- oder kommunale Behörden weitergeleitet werden. </p>
<!-- END OUTPUT from 'modules/contrib/webform/templates/webform-email-message-html.html.twig' -->
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
<!-- END OUTPUT from 'themes/custom/hw_radix_standard/templates/mail/symfony-mailer-lite-email.html.twig' -->
We did not have any special template with all the styles for the mail body.
So I wonder where this information did come from before.
Any changes in webform module, core or is symfony-mailer just dropping it?
Found this issue in symfony-mailer-lite https://git.drupalcode.org/project/symfony_mailer_lite/-/commit/623c53acc21bd1d82fad41bec7cfd8eacd1e7546 and changed the config to not use the default content in the message settings of symfony-mailer-lite - but no change to the behaviour. Somehow the HTML of message.body from webform gehts stripped.