fix: better error handling / messsage when testing email notification when stmp is not configured, fixes #8093

This commit is contained in:
Torkel Ödegaard
2017-04-25 13:16:37 +02:00
parent 8beb873db4
commit 87c978ebc9
3 changed files with 5 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ func createDialer() (*gomail.Dialer, error) {
func buildEmailMessage(cmd *m.SendEmailCommand) (*Message, error) {
if !setting.Smtp.Enabled {
return nil, errors.New("Grafana mailing/smtp options not configured, contact your Grafana admin")
return nil, m.ErrSmtpNotEnabled
}
var buffer bytes.Buffer