Improve HTML check in notif template loading. Closes #903.

This commit is contained in:
Kailash Nadh 2022-09-10 12:21:53 +05:30
parent f266f93cc8
commit edb4c9168d

View file

@ -615,7 +615,7 @@ func initNotifTemplates(path string, fs stuffbin.FileSystem, i *i18n.I18n, cs *c
h := make([]byte, ln) h := make([]byte, ln)
copy(h, html[0:ln]) copy(h, html[0:ln])
if !bytes.Contains(bytes.ToLower(h), []byte("<!doctype html>")) { if !bytes.Contains(bytes.ToLower(h), []byte("<!doctype html")) {
out.contentType = models.CampaignContentTypePlain out.contentType = models.CampaignContentTypePlain
lo.Println("system e-mail templates are plaintext") lo.Println("system e-mail templates are plaintext")
} }