mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-15 11:53:24 +00:00
feat: e-mail templates (#1158)
* View definition added * Get templates and texts from the database. * Fill in texts in templates * Fill in texts in templates * Client API added * Weekly backup * Weekly backup * Daily backup * Weekly backup * Tests added * Corrections from merge branch * Fixes from pull request review
This commit is contained in:
32
internal/api/grpc/admin/text.go
Normal file
32
internal/api/grpc/admin/text.go
Normal file
@@ -0,0 +1,32 @@
|
||||
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.iam.ChangeDefaultMailText(ctx, textToModel(text))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return textFromModel(result), nil
|
||||
}
|
||||
Reference in New Issue
Block a user