summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 67018cf839..63635636b2 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -1252,11 +1252,11 @@ func newSessionService() {
// Mailer represents mail service.
type Mailer struct {
// Mailer
- QueueLength int
- Name string
- From string
- FromEmail string
- EnableHTMLAlternative bool
+ QueueLength int
+ Name string
+ From string
+ FromEmail string
+ SendAsPlainText bool
// SMTP sender
Host string
@@ -1285,9 +1285,9 @@ func newMailService() {
}
MailService = &Mailer{
- QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
- Name: sec.Key("NAME").MustString(AppName),
- EnableHTMLAlternative: sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(),
+ QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100),
+ Name: sec.Key("NAME").MustString(AppName),
+ SendAsPlainText: sec.Key("SEND_AS_PLAIN_TEXT").MustBool(false),
Host: sec.Key("HOST").String(),
User: sec.Key("USER").String(),
@@ -1304,6 +1304,11 @@ func newMailService() {
}
MailService.From = sec.Key("FROM").MustString(MailService.User)
+ if sec.HasKey("ENABLE_HTML_ALTERNATIVE") {
+ log.Warn("ENABLE_HTML_ALTERNATIVE is deprecated, use SEND_AS_PLAIN_TEXT")
+ MailService.SendAsPlainText = !sec.Key("ENABLE_HTML_ALTERNATIVE").MustBool(false)
+ }
+
parsed, err := mail.ParseAddress(MailService.From)
if err != nil {
log.Fatal(4, "Invalid mailer.FROM (%s): %v", MailService.From, err)