[MM-15661] Create SendNotificationEmail and move config option check to it (#11478)

Этот коммит содержится в:
Miguel de la Cruz
2019-07-04 14:16:41 +01:00
коммит произвёл GitHub
родитель 2f9d509284
Коммит 8a13c9d1d5
6 изменённых файлов: 26 добавлений и 20 удалений

Просмотреть файл

@@ -179,6 +179,10 @@ func (a *App) TestEmail(userId string, cfg *model.Config) *model.AppError {
return model.NewAppError("testEmail", "api.admin.test_email.missing_server", nil, utils.T("api.context.invalid_param.app_error", map[string]interface{}{"Name": "SMTPServer"}), http.StatusBadRequest)
}
if !*cfg.EmailSettings.SendEmailNotifications {
return nil
}
// if the user hasn't changed their email settings, fill in the actual SMTP password so that
// the user can verify an existing SMTP connection
if *cfg.EmailSettings.SMTPPassword == model.FAKE_SETTING {