diff options
author | Guy Smoilov <guy.smoilov@gmail.com> | 2018-12-25 17:08:00 +0200 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2018-12-25 10:08:00 -0500 |
commit | 5702e4bc2483ab976a1391f7517f5187527d9635 (patch) | |
tree | 5b7ceab6f81277525bd566186e6e48d5e40158fe /pkg/setting/setting.go | |
parent | 9b37b1569c2d466dc8293ed482c1549aa9a6d4a9 (diff) |
pkg/mailer: support plaintext alt for HTML emails (#5568)
* Added option to use plain text alt to HTML emails. Should make the messages friendlier for spam filters.
* Check that plaintext conversion worked before adding the HTML alt
* Add description of ADD_PLAIN_TEXT_ALT to app.ini
* Added comment clarifying html AddAlternative
Diffstat (limited to 'pkg/setting/setting.go')
-rw-r--r-- | pkg/setting/setting.go | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index b65de982..f293c73a 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -861,6 +861,7 @@ type Mailer struct { UseCertificate bool CertFile, KeyFile string UsePlainText bool + AddPlainTextAlt bool } var ( @@ -876,18 +877,19 @@ func newMailService() { } MailService = &Mailer{ - QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100), - SubjectPrefix: sec.Key("SUBJECT_PREFIX").MustString("[" + AppName + "] "), - Host: sec.Key("HOST").String(), - User: sec.Key("USER").String(), - Passwd: sec.Key("PASSWD").String(), - DisableHelo: sec.Key("DISABLE_HELO").MustBool(), - HeloHostname: sec.Key("HELO_HOSTNAME").String(), - SkipVerify: sec.Key("SKIP_VERIFY").MustBool(), - UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(), - CertFile: sec.Key("CERT_FILE").String(), - KeyFile: sec.Key("KEY_FILE").String(), - UsePlainText: sec.Key("USE_PLAIN_TEXT").MustBool(), + QueueLength: sec.Key("SEND_BUFFER_LEN").MustInt(100), + SubjectPrefix: sec.Key("SUBJECT_PREFIX").MustString("[" + AppName + "] "), + Host: sec.Key("HOST").String(), + User: sec.Key("USER").String(), + Passwd: sec.Key("PASSWD").String(), + DisableHelo: sec.Key("DISABLE_HELO").MustBool(), + HeloHostname: sec.Key("HELO_HOSTNAME").String(), + SkipVerify: sec.Key("SKIP_VERIFY").MustBool(), + UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(), + CertFile: sec.Key("CERT_FILE").String(), + KeyFile: sec.Key("KEY_FILE").String(), + UsePlainText: sec.Key("USE_PLAIN_TEXT").MustBool(), + AddPlainTextAlt: sec.Key("ADD_PLAIN_TEXT_ALT").MustBool(), } MailService.From = sec.Key("FROM").MustString(MailService.User) |