Emails: resurrect template notification (#18686)
* Emails: resurrect template notification * Phantomjs (oh yeah, there is another dev dep phantom :-) was failing for the generation of the html templates so I had to update the dependencies in order to fix it. While doing that I update the scripts field and docs for it as well. yarn.lock is included * Move splitting of the emails to separate helper function, since more services coming up that would need to use this functionality * Add support for enterprise specific email letters. Probably could be done in the better way, but it's not a priority right now
This commit is contained in:
@@ -2,11 +2,11 @@ package notifiers
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/alerting"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
@@ -48,13 +48,7 @@ func NewEmailNotifier(model *models.AlertNotification) (alerting.Notifier, error
|
||||
}
|
||||
|
||||
// split addresses with a few different ways
|
||||
addresses := strings.FieldsFunc(addressesString, func(r rune) bool {
|
||||
switch r {
|
||||
case ',', ';', '\n':
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
addresses := util.SplitEmails(addressesString)
|
||||
|
||||
return &EmailNotifier{
|
||||
NotifierBase: NewNotifierBase(model),
|
||||
|
||||
Reference in New Issue
Block a user