package admin import ( "golang.org/x/text/language" "github.com/caos/zitadel/internal/domain" admin_pb "github.com/caos/zitadel/pkg/grpc/admin" ) func SetInitCustomTextToDomain(msg *admin_pb.SetDefaultInitMessageTextRequest) *domain.CustomMessageText { langTag := language.Make(msg.Language) return &domain.CustomMessageText{ MessageTextType: domain.InitCodeMessageType, Language: langTag, Title: msg.Title, PreHeader: msg.PreHeader, Subject: msg.Subject, Greeting: msg.Greeting, Text: msg.Text, ButtonText: msg.ButtonText, FooterText: msg.FooterText, } } func SetPasswordResetCustomTextToDomain(msg *admin_pb.SetDefaultPasswordResetMessageTextRequest) *domain.CustomMessageText { langTag := language.Make(msg.Language) return &domain.CustomMessageText{ MessageTextType: domain.PasswordResetMessageType, Language: langTag, Title: msg.Title, PreHeader: msg.PreHeader, Subject: msg.Subject, Greeting: msg.Greeting, Text: msg.Text, ButtonText: msg.ButtonText, FooterText: msg.FooterText, } } func SetVerifyEmailCustomTextToDomain(msg *admin_pb.SetDefaultVerifyEmailMessageTextRequest) *domain.CustomMessageText { langTag := language.Make(msg.Language) return &domain.CustomMessageText{ MessageTextType: domain.VerifyEmailMessageType, Language: langTag, Title: msg.Title, PreHeader: msg.PreHeader, Subject: msg.Subject, Greeting: msg.Greeting, Text: msg.Text, ButtonText: msg.ButtonText, FooterText: msg.FooterText, } } func SetVerifyPhoneCustomTextToDomain(msg *admin_pb.SetDefaultVerifyPhoneMessageTextRequest) *domain.CustomMessageText { langTag := language.Make(msg.Language) return &domain.CustomMessageText{ MessageTextType: domain.VerifyPhoneMessageType, Language: langTag, Title: msg.Title, PreHeader: msg.PreHeader, Subject: msg.Subject, Greeting: msg.Greeting, Text: msg.Text, ButtonText: msg.ButtonText, FooterText: msg.FooterText, } } func SetDomainClaimedCustomTextToDomain(msg *admin_pb.SetDefaultDomainClaimedMessageTextRequest) *domain.CustomMessageText { langTag := language.Make(msg.Language) return &domain.CustomMessageText{ MessageTextType: domain.DomainClaimedMessageType, Language: langTag, Title: msg.Title, PreHeader: msg.PreHeader, Subject: msg.Subject, Greeting: msg.Greeting, Text: msg.Text, ButtonText: msg.ButtonText, FooterText: msg.FooterText, } }