mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added configuration options for smtp
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package setting
|
||||
|
||||
type SmtpSettings struct {
|
||||
Enabled bool
|
||||
Host string
|
||||
User string
|
||||
Password string
|
||||
@@ -8,4 +9,21 @@ type SmtpSettings struct {
|
||||
KeyFile string
|
||||
FromAddress string
|
||||
SkipVerify bool
|
||||
|
||||
SendWelcomeEmailOnSignUp bool
|
||||
}
|
||||
|
||||
func readSmtpSettings() {
|
||||
sec := Cfg.Section("smtp")
|
||||
Smtp.Enabled = sec.Key("enabled").MustBool(false)
|
||||
Smtp.Host = sec.Key("host").String()
|
||||
Smtp.User = sec.Key("user").String()
|
||||
Smtp.Password = sec.Key("password").String()
|
||||
Smtp.CertFile = sec.Key("cert_file").String()
|
||||
Smtp.KeyFile = sec.Key("key_file").String()
|
||||
Smtp.FromAddress = sec.Key("from_address").String()
|
||||
Smtp.SkipVerify = sec.Key("skip_verify").MustBool(false)
|
||||
|
||||
emails := Cfg.Section("emails")
|
||||
Smtp.SendWelcomeEmailOnSignUp = emails.Key("welcome_email_on_sign_up").MustBool(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user