Mailings with no text in HTML body are sent empty
There's an issue when an Individual Email or Scheduled Reminders are sent with a Html Body that does not contain any text, no matter the HTML tags in the source, the email is sent with an empty body.
This type of HTML body is common specially in Scheduled reminders where only a generic <img>
tag is included in the body (for Anniversaries, Birthdays, etc..), the user will receive an empty email.
The culprit is this line: https://github.com/civicrm/civicrm-core/blob/5.39.0/CRM/Utils/Mail.php#L191
Which trims the HTML body if it does not contain any text, rather than html tags.
This does not reproduce in CiviMailings, because it's mandatory to include optOut links, so at least they have some text