mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
fix(alerting): fixed email notification so it splits email address multiple ways, fixes #6353
This commit is contained in:
parent
b32bbbd1a2
commit
4999fff29b
@ -29,9 +29,18 @@ func NewEmailNotifier(model *m.AlertNotification) (alerting.Notifier, error) {
|
||||
return nil, alerting.ValidationError{Reason: "Could not find addresses in settings"}
|
||||
}
|
||||
|
||||
// split addresses with a few different ways
|
||||
addresses := strings.FieldsFunc(addressesString, func(r rune) bool {
|
||||
switch r {
|
||||
case ',', ';', '\n':
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
return &EmailNotifier{
|
||||
NotifierBase: NewNotifierBase(model.Id, model.IsDefault, model.Name, model.Type, model.Settings),
|
||||
Addresses: strings.Split(addressesString, `;`),
|
||||
Addresses: addresses,
|
||||
log: log.New("alerting.notifier.email"),
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user