grafana/pkg/setting/setting_smtp.go

32 lines
907 B
Go
Raw Normal View History

2015-06-04 07:29:39 -05:00
package setting
type SmtpSettings struct {
2015-06-08 10:56:56 -05:00
Enabled bool
2015-06-04 07:29:39 -05:00
Host string
User string
Password string
CertFile string
KeyFile string
FromAddress string
SkipVerify bool
2015-06-08 10:56:56 -05:00
SendWelcomeEmailOnSignUp bool
TemplatesPattern string
2015-06-08 10:56:56 -05:00
}
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)
Smtp.TemplatesPattern = emails.Key("templates_pattern").MustString("emails/*.html")
2015-06-04 07:29:39 -05:00
}