#2954 minor fix for when to set HTML alternative

release/v1.15
Unknwon 2016-05-30 01:50:20 -07:00
parent 3d105733a9
commit 0240f520ab
1 changed files with 3 additions and 5 deletions

View File

@ -38,14 +38,12 @@ func NewMessageFrom(to []string, from, subject, htmlBody string) *Message {
if err != nil {
log.Error(4, "html2text.FromString: %v", err)
msg.SetBody("text/html", htmlBody)
msg.AddAlternative("text/html", htmlBody)
} else {
msg.SetBody("text/plain", body)
}
if setting.MailService.EnableHTMLAlternative {
msg.AddAlternative("text/html", htmlBody)
}
}
return &Message{
Message: msg,