added auto html to plain text mail generation

This commit is contained in:
Gani Georgiev
2022-08-26 06:46:34 +03:00
parent f14105b04a
commit 0f9ddbf7ec
13 changed files with 255 additions and 14 deletions
+5
View File
@@ -68,6 +68,11 @@ func (m *SmtpClient) Send(
yak.Subject(subject)
yak.HTML().Set(htmlContent)
// try to generate a plain text version of the HTML
if plain, err := html2Text(htmlContent); err == nil {
yak.Plain().Set(plain)
}
for name, data := range attachments {
yak.Attach(name, data)
}