mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-17 00:13:44 +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:
24
internal/api/grpc/admin/template.go
Normal file
24
internal/api/grpc/admin/template.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/caos/zitadel/pkg/grpc/admin"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
)
|
||||
|
||||
func (s *Server) GetDefaultMailTemplate(ctx context.Context, _ *empty.Empty) (*admin.DefaultMailTemplateView, error) {
|
||||
result, err := s.iam.GetDefaultMailTemplate(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return templateViewFromModel(result), nil
|
||||
}
|
||||
|
||||
func (s *Server) UpdateDefaultMailTemplate(ctx context.Context, policy *admin.DefaultMailTemplateUpdate) (*admin.DefaultMailTemplate, error) {
|
||||
result, err := s.iam.ChangeDefaultMailTemplate(ctx, templateToModel(policy))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return templateFromModel(result), nil
|
||||
}
|
||||
Reference in New Issue
Block a user