System Console: Email notification content setting (#7122)
* PLT-7195: Added new config option, new license feature, and config UI to system console. Still need to implement behaviour change in email batching code * PLT-7195: Modified batch emails to respect email notification content type setting * PLT-7195: Tweaking the colours a bit * PLT-7195: Added support for email notification content type setting in immediate (non-batched) notification messages. Attempted to clean up the code somewhat. Unit tests coming in a future commit * PLT-7195: Added unit tests for non-batched emails * Checked license when applying email content settings * Changed return type of getFormattedPostTime
Этот коммит содержится в:
коммит произвёл
Saturnino Abril
родитель
9f3713aa98
Коммит
178ccd16cb
@@ -442,6 +442,7 @@ func getClientConfig(c *model.Config) map[string]string {
|
||||
props["EnableSignInWithUsername"] = strconv.FormatBool(*c.EmailSettings.EnableSignInWithUsername)
|
||||
props["RequireEmailVerification"] = strconv.FormatBool(c.EmailSettings.RequireEmailVerification)
|
||||
props["EnableEmailBatching"] = strconv.FormatBool(*c.EmailSettings.EnableEmailBatching)
|
||||
props["EmailNotificationContentsType"] = *c.EmailSettings.EmailNotificationContentsType
|
||||
|
||||
props["EnableSignUpWithGitLab"] = strconv.FormatBool(c.GitLabSettings.Enable)
|
||||
|
||||
|
||||
@@ -277,3 +277,13 @@ func TestValidateLocales(t *testing.T) {
|
||||
t.Fatal("Should have returned an error validating AvailableLocales")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetClientConfig(t *testing.T) {
|
||||
TranslationsPreInit()
|
||||
LoadConfig("config.json")
|
||||
|
||||
configMap := getClientConfig(Cfg)
|
||||
if configMap["EmailNotificationContentsType"] != *Cfg.EmailSettings.EmailNotificationContentsType {
|
||||
t.Fatal("EmailSettings.EmailNotificationContentsType not exposed to client config")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,6 +186,7 @@ func getClientLicense(l *model.License) map[string]string {
|
||||
props["Email"] = l.Customer.Email
|
||||
props["Company"] = l.Customer.Company
|
||||
props["PhoneNumber"] = l.Customer.PhoneNumber
|
||||
props["EmailNotificationContents"] = strconv.FormatBool(*l.Features.EmailNotificationContents)
|
||||
}
|
||||
|
||||
return props
|
||||
|
||||
Ссылка в новой задаче
Block a user