zitadel/internal/api/grpc/admin/template.go
Michael Waeger f2a32871a7
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
2021-01-18 14:17:22 +01:00

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
}