Skip to content

Commit

Permalink
Changed to not ignore html2text errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cez81 committed Jun 6, 2017
1 parent 12fd2da commit 094bd67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/mailer/mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func NewMessageFrom(to []string, from, subject, body string) *Message {
msg.SetHeader("Subject", subject)
msg.SetDateHeader("Date", time.Now())

plainBody, _ := html2text.FromString(body)
if setting.MailService.SendAsPlainText {
plainBody, err := html2text.FromString(body)
if err != nil || setting.MailService.SendAsPlainText {
if strings.Contains(body[:100], "<html>") {
log.Warn("Mail contains HTML but configured to send as plain text.")
}
Expand Down

0 comments on commit 094bd67

Please sign in to comment.