mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 03:54:21 +00:00
fbc75d89b2
* feat: mail template/text events * feat: mail template/text events * feat: mail template/text on iam and org * feat: setup step 10 * fix: add template event * fix: add unique constraints * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/static/i18n/de.yaml Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/iam_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_template.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/v2/command/org_policy_mail_text.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: org iam policy Co-authored-by: Livio Amstutz <livio.a@gmail.com>
33 lines
918 B
Go
33 lines
918 B
Go
package admin
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/zitadel/pkg/grpc/admin"
|
|
"github.com/golang/protobuf/ptypes/empty"
|
|
)
|
|
|
|
func (s *Server) GetDefaultMailTexts(ctx context.Context, _ *empty.Empty) (*admin.DefaultMailTextsView, error) {
|
|
result, err := s.iam.GetDefaultMailTexts(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return textsViewFromModel(result), nil
|
|
}
|
|
|
|
func (s *Server) GetDefaultMailText(ctx context.Context, textType string, language string) (*admin.DefaultMailTextView, error) {
|
|
result, err := s.iam.GetDefaultMailText(ctx, textType, language)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return textViewFromModel(result), nil
|
|
}
|
|
|
|
func (s *Server) UpdateDefaultMailText(ctx context.Context, text *admin.DefaultMailTextUpdate) (*admin.DefaultMailText, error) {
|
|
result, err := s.command.ChangeDefaultMailText(ctx, textToDomain(text))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return textFromDomain(result), nil
|
|
}
|