summaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-05-30 01:50:20 -0700
committerUnknwon <u@gogs.io>2016-05-30 01:50:20 -0700
commit0240f520ab2565749b7244e79ca2f30f780af46d (patch)
tree84dc8a76275e510611f0379bbe8032862ea4dfde /modules/mailer
parent3d105733a9f2b2f01064abaaf9396023866c3547 (diff)
downloadgitea-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.go8
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{