mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 12:43:50 +08:00
Config: Can add static headers to email messages (#79365)
* Can add allowed custom headers to an email Message. WIP. * adds slug as a custom email header to all outgoing emails * Headers are static - declared as key/value pairs in config. All static headers get added to emails. * updates comment * adds tests for parsing smtp static headers * updates test to assert static headers are included when building email * updates test to use multiple static headers * updates test names * fixes linting issue with error * ignore gocyclo for loading config * updates email headers in tests to be formatted properly * add static headers first * updates tests to assert that regular headers like From cant be overwritten * ensures only the header is in a valid format for smtp and not the value * updates comment and error message wording * adds to docs and ini sample files * updates smtp.static_headers docs examples formatting * removes lines commented with semi colons * prettier:write * renames var
This commit is contained in:
@ -1026,6 +1026,7 @@ func (cfg *Cfg) validateStaticRootPath() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// nolint:gocyclo
|
||||
func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
cfg.setHomePath(args)
|
||||
|
||||
@ -1197,7 +1198,9 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
|
||||
cfg.handleAWSConfig()
|
||||
cfg.readAzureSettings()
|
||||
cfg.readSessionConfig()
|
||||
cfg.readSmtpSettings()
|
||||
if err := cfg.readSmtpSettings(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := cfg.readAnnotationSettings(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user