forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setting_smtp.go
35 lines (31 loc) · 1.03 KB
/
setting_smtp.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package setting
type SmtpSettings struct {
Enabled bool
Host string
User string
Password string
CertFile string
KeyFile string
FromAddress string
FromName string
EhloIdentity string
SkipVerify bool
SendWelcomeEmailOnSignUp bool
TemplatesPattern string
}
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.FromName = sec.Key("from_name").String()
Smtp.EhloIdentity = sec.Key("ehlo_identity").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")
}