mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 05:07:31 +00:00
feat: custom message text (#1801)
* feat: default custom message text * feat: org custom message text * feat: org custom message text * feat: custom messages query side * feat: default messages * feat: message text user fields * feat: check for inactive user * feat: fix send password reset * feat: fix custom org text * feat: add variables to docs * feat: custom text tests * feat: fix notifications * feat: add custom text feature * feat: add custom text feature * feat: feature in custom message texts * feat: add custom text feature in frontend * feat: merge main * feat: feature tests * feat: change phone message in setup * fix: remove unused code, add event translation * fix: merge main and fix problems * fix: english translation file * fix: migration versions * fix: setup * feat: fix pr requests * feat: fix phone code message * feat: migration * feat: setup * fix: remove unused tests Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
42
internal/domain/custom_messge_text.go
Normal file
42
internal/domain/custom_messge_text.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
)
|
||||
|
||||
const (
|
||||
InitCodeMessageType = "InitCode"
|
||||
PasswordResetMessageType = "PasswordReset"
|
||||
VerifyEmailMessageType = "VerifyEmail"
|
||||
VerifyPhoneMessageType = "VerifyPhone"
|
||||
DomainClaimedMessageType = "DomainClaimed"
|
||||
MessageTitle = "Title"
|
||||
MessagePreHeader = "PreHeader"
|
||||
MessageSubject = "Subject"
|
||||
MessageGreeting = "Greeting"
|
||||
MessageText = "Text"
|
||||
MessageButtonText = "ButtonText"
|
||||
MessageFooterText = "FooterText"
|
||||
)
|
||||
|
||||
type CustomMessageText struct {
|
||||
models.ObjectRoot
|
||||
|
||||
State PolicyState
|
||||
Default bool
|
||||
MessageTextType string
|
||||
Language language.Tag
|
||||
Title string
|
||||
PreHeader string
|
||||
Subject string
|
||||
Greeting string
|
||||
Text string
|
||||
ButtonText string
|
||||
FooterText string
|
||||
}
|
||||
|
||||
func (m *CustomMessageText) IsValid() bool {
|
||||
return m.MessageTextType != "" && m.Language != language.Und
|
||||
}
|
32
internal/domain/custom_text.go
Normal file
32
internal/domain/custom_text.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
)
|
||||
|
||||
type CustomText struct {
|
||||
models.ObjectRoot
|
||||
|
||||
State CustomTextState
|
||||
Default bool
|
||||
Template string
|
||||
Key string
|
||||
Language language.Tag
|
||||
Text string
|
||||
}
|
||||
|
||||
type CustomTextState int32
|
||||
|
||||
const (
|
||||
CustomTextStateUnspecified CustomTextState = iota
|
||||
CustomTextStateActive
|
||||
CustomTextStateRemoved
|
||||
|
||||
customTextStateCount
|
||||
)
|
||||
|
||||
func (m *CustomText) IsValid() bool {
|
||||
return m.Key != "" && m.Language != language.Und && m.Text != ""
|
||||
}
|
@@ -18,6 +18,7 @@ const (
|
||||
FeatureLabelPolicy = "label_policy"
|
||||
FeatureLabelPolicyPrivateLabel = FeatureLabelPolicy + ".private_label"
|
||||
FeatureLabelPolicyWatermark = FeatureLabelPolicy + ".watermark"
|
||||
FeatureCustomText = "custom_text"
|
||||
FeatureCustomDomain = "custom_domain"
|
||||
)
|
||||
|
||||
@@ -41,6 +42,7 @@ type Features struct {
|
||||
LabelPolicyPrivateLabel bool
|
||||
LabelPolicyWatermark bool
|
||||
CustomDomain bool
|
||||
CustomText bool
|
||||
}
|
||||
|
||||
type FeaturesState int32
|
||||
|
@@ -1,22 +0,0 @@
|
||||
package domain
|
||||
|
||||
import "github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
|
||||
type MailText struct {
|
||||
models.ObjectRoot
|
||||
|
||||
State PolicyState
|
||||
Default bool
|
||||
MailTextType string
|
||||
Language string
|
||||
Title string
|
||||
PreHeader string
|
||||
Subject string
|
||||
Greeting string
|
||||
Text string
|
||||
ButtonText string
|
||||
}
|
||||
|
||||
func (m *MailText) IsValid() bool {
|
||||
return m.MailTextType != "" && m.Language != "" && m.Title != "" && m.PreHeader != "" && m.Subject != "" && m.Greeting != "" && m.Text != "" && m.ButtonText != ""
|
||||
}
|
@@ -18,6 +18,7 @@ const (
|
||||
Step13
|
||||
Step14
|
||||
Step15
|
||||
Step16
|
||||
//StepCount marks the the length of possible steps (StepCount-1 == last possible step)
|
||||
StepCount
|
||||
)
|
||||
|
Reference in New Issue
Block a user