diff options
author | Unknwon <u@gogs.io> | 2016-05-30 01:50:20 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-05-30 01:50:20 -0700 |
commit | 0240f520ab2565749b7244e79ca2f30f780af46d (patch) | |
tree | 84dc8a76275e510611f0379bbe8032862ea4dfde /modules/mailer | |
parent | 3d105733a9f2b2f01064abaaf9396023866c3547 (diff) | |
download | gitea-0240f520ab2565749b7244e79ca2f30f780af46d.tar.gz gitea-0240f520ab2565749b7244e79ca2f30f780af46d.zip |
#2954 minor fix for when to set HTML alternative
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 6a979969e4..13d80b5648 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -38,13 +38,11 @@ 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) + if setting.MailService.EnableHTMLAlternative { + msg.AddAlternative("text/html", htmlBody) + } } return &Message{ |