Reduce the coupling of the mailservice with the rest of the application (#16898)
* Reduce the coupling of the mailservice with the rest of the application * Fixing tests in CI * Simplifiying mailservice config * Addressing PR review comments * Fixing tests * Removing unnecesary type definition * Fixing ServerName usage
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
69ff686667
Коммит
d06a62ce64
@@ -226,7 +226,8 @@ func (a *App) TestEmail(userID string, cfg *model.Config) *model.AppError {
|
||||
|
||||
T := utils.GetUserTranslations(user.Locale)
|
||||
license := a.Srv().License()
|
||||
if err := mailservice.SendMailUsingConfig(user.Email, T("api.admin.test_email.subject"), T("api.admin.test_email.body"), cfg, license != nil && *license.Features.Compliance, ""); err != nil {
|
||||
mailConfig := a.Srv().MailServiceConfig()
|
||||
if err := mailservice.SendMailUsingConfig(user.Email, T("api.admin.test_email.subject"), T("api.admin.test_email.body"), mailConfig, license != nil && *license.Features.Compliance, ""); err != nil {
|
||||
return model.NewAppError("testEmail", "app.admin.test_email.failure", map[string]interface{}{"Error": err.Error()}, "", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user