[CLD-6536] Adjustments to cloud annual renewal announcement bar (#25927)
* Adjustments to cloud annual renewal announcement bar * Add exclusion for trials * Add more exceptions for when on trial during renewal period * Add support for simulated_current_time_ms * A few more changes to allow us to test this post-merge * Fix tests, pipeline * Final fix around emails --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -111,6 +111,10 @@ func getSubscription(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if model.GetServiceEnvironment() != model.ServiceEnvironmentTest {
|
||||
subscription.SimulatedCurrentTimeMs = nil
|
||||
}
|
||||
|
||||
if !c.App.Config().FeatureFlags.CloudAnnualRenewals {
|
||||
subscription.WillRenew = ""
|
||||
subscription.CancelAt = nil
|
||||
|
||||
@@ -285,6 +285,10 @@ func (a *App) DoSubscriptionRenewalCheck() {
|
||||
return
|
||||
}
|
||||
|
||||
if subscription.IsFreeTrial == "true" {
|
||||
return // Don't send renewal emails for free trials
|
||||
}
|
||||
|
||||
sysVar, err := a.Srv().Store().System().GetByName(model.CloudRenewalEmail)
|
||||
if err != nil {
|
||||
// We only care about the error if it wasn't a not found error
|
||||
@@ -318,13 +322,13 @@ func (a *App) DoSubscriptionRenewalCheck() {
|
||||
|
||||
// Only send the email if within the period and it's not already been sent
|
||||
// This allows the email to send on day 59 if for whatever reason it was unable to on day 60
|
||||
if daysToExpiration <= 60 && daysToExpiration > 30 && prevSentEmail != 60 {
|
||||
if daysToExpiration <= 60 && daysToExpiration > 30 && prevSentEmail != 60 && !(prevSentEmail < 60) {
|
||||
emailFunc = a.Srv().EmailService.SendCloudRenewalEmail60
|
||||
prevSentEmail = 60
|
||||
} else if daysToExpiration <= 30 && daysToExpiration > 7 && prevSentEmail != 30 {
|
||||
} else if daysToExpiration <= 30 && daysToExpiration > 7 && prevSentEmail != 30 && !(prevSentEmail < 30) {
|
||||
emailFunc = a.Srv().EmailService.SendCloudRenewalEmail30
|
||||
prevSentEmail = 30
|
||||
} else if daysToExpiration <= 7 && daysToExpiration > 3 && prevSentEmail != 7 {
|
||||
} else if daysToExpiration <= 7 && daysToExpiration >= 0 && prevSentEmail != 7 {
|
||||
emailFunc = a.Srv().EmailService.SendCloudRenewalEmail7
|
||||
prevSentEmail = 7
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user