Feature: Support Cloud 14-day Trial (#17397)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Nick Misasi <nick.misasi@mattermost.com> Co-authored-by: Allan Guwatudde <guwats10@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e8b710f7fe
Коммит
81c40174e6
@@ -7,6 +7,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"time"
|
||||
@@ -411,6 +412,16 @@ func handleCWSWebhook(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
c.Err = appErr
|
||||
return
|
||||
}
|
||||
case model.EventTypeTrialWillEnd:
|
||||
endTimeStamp := event.SubscriptionTrialEndUnixTimeStamp
|
||||
t := time.Unix(endTimeStamp, 0)
|
||||
trialEndDate := fmt.Sprintf("%s %d, %d", t.Month(), t.Day(), t.Year())
|
||||
|
||||
if appErr := c.App.SendCloudTrialEndWarningEmail(trialEndDate, *c.App.Config().ServiceSettings.SiteURL); appErr != nil {
|
||||
c.Err = appErr
|
||||
return
|
||||
}
|
||||
|
||||
default:
|
||||
c.Err = model.NewAppError("Api4.handleCWSWebhook", "api.cloud.cws_webhook_event_missing_error", nil, "", http.StatusNotFound)
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user