[MM-45053] - Remove 'trial of Mattermost ending soon' product emails (#20550)

* [MM-45053] - Remove 'trial of Mattermost ending soon' product emails

* remove trial end warning email
Этот коммит содержится в:
Allan Guwatudde
2022-06-30 09:18:13 +03:00
коммит произвёл GitHub
родитель 83b4e7285e
Коммит b445440600
14 изменённых файлов: 0 добавлений и 1425 удалений

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

@@ -123,62 +123,3 @@ func (a *App) SendNoCardPaymentFailedEmail() *model.AppError {
}
return nil
}
func (a *App) SendCloudTrialEndWarningEmail(trialEndDate, siteURL string) *model.AppError {
sysAdmins, e := a.getSysAdminsEmailRecipients()
if e != nil {
return e
}
// we want to at least have one email sent out to an admin
countNotOks := 0
for admin := range sysAdmins {
name := sysAdmins[admin].FirstName
if name == "" {
name = sysAdmins[admin].Username
}
err := a.Srv().EmailService.SendCloudTrialEndWarningEmail(sysAdmins[admin].Email, name, trialEndDate, sysAdmins[admin].Locale, siteURL)
if err != nil {
a.Log().Error("Error sending trial ending warning to", mlog.String("email", sysAdmins[admin].Email), mlog.Err(err))
countNotOks++
}
}
// if not even one admin got an email, we consider that this operation errored
if countNotOks == len(sysAdmins) {
return model.NewAppError("app.SendCloudTrialEndWarningEmail", "app.user.send_emails.app_error", nil, "", http.StatusInternalServerError)
}
return nil
}
func (a *App) SendCloudTrialEndedEmail() *model.AppError {
sysAdmins, e := a.getSysAdminsEmailRecipients()
if e != nil {
return e
}
// we want to at least have one email sent out to an admin
countNotOks := 0
for admin := range sysAdmins {
name := sysAdmins[admin].FirstName
if name == "" {
name = sysAdmins[admin].Username
}
err := a.Srv().EmailService.SendCloudTrialEndedEmail(sysAdmins[admin].Email, name, sysAdmins[admin].Locale, *a.Config().ServiceSettings.SiteURL)
if err != nil {
a.Log().Error("Error sending trial ended email to", mlog.String("email", sysAdmins[admin].Email), mlog.Err(err))
countNotOks++
}
}
// if not even one admin got an email, we consider that this operation errored
if countNotOks == len(sysAdmins) {
return model.NewAppError("app.SendCloudTrialEndedEmail", "app.user.send_emails.app_error", nil, "", http.StatusInternalServerError)
}
return nil
}