mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-10 22:53:42 +00:00
f2a32871a7
* 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
25 lines
677 B
Go
25 lines
677 B
Go
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
|
|
}
|