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
Этот коммит содержится в:
Jesús Espino
2021-02-16 12:42:03 +01:00
коммит произвёл GitHub
родитель 69ff686667
Коммит d06a62ce64
8 изменённых файлов: 160 добавлений и 242 удалений

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

@@ -115,7 +115,9 @@ func (s *Server) DoSecurityUpdateCheck() {
for _, user := range users {
mlog.Info("Sending security bulletin", mlog.String("bulletin_id", bulletin.Id), mlog.String("user_email", user.Email))
license := s.License()
mailservice.SendMailUsingConfig(user.Email, utils.T("mattermost.bulletin.subject"), string(body), s.Config(), license != nil && *license.Features.Compliance, "")
mailConfig := s.MailServiceConfig()
mailservice.SendMailUsingConfig(user.Email, utils.T("mattermost.bulletin.subject"), string(body), mailConfig, license != nil && *license.Features.Compliance, "")
}
bulletinSeen := &model.System{Name: "SecurityBulletin_" + bulletin.Id, Value: bulletin.Id}