mirror of
https://github.com/zitadel/zitadel.git
synced 2025-04-09 09:14:33 +00:00

* fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename orgiampolicy to domain policy * fix: merge conflicts * fix: protos * fix: md files * implement deprecated org iam policy again Co-authored-by: Livio Amstutz <livio.a@gmail.com>
39 lines
970 B
Go
39 lines
970 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/caos/logging"
|
|
|
|
"github.com/caos/zitadel/internal/domain"
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
)
|
|
|
|
type Step10 struct {
|
|
DefaultMailTemplate domain.MailTemplate
|
|
}
|
|
|
|
func (s *Step10) Step() domain.Step {
|
|
return domain.Step10
|
|
}
|
|
|
|
func (s *Step10) execute(ctx context.Context, commandSide *Commands) error {
|
|
return commandSide.SetupStep10(ctx, s)
|
|
}
|
|
|
|
func (c *Commands) SetupStep10(ctx context.Context, step *Step10) error {
|
|
fn := func(iam *InstanceWriteModel) ([]eventstore.Command, error) {
|
|
iamAgg := InstanceAggregateFromWriteModel(&iam.WriteModel)
|
|
mailTemplateEvent, err := c.addDefaultMailTemplate(ctx, iamAgg, NewInstanceMailTemplateWriteModel(), &step.DefaultMailTemplate)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
events := []eventstore.Command{
|
|
mailTemplateEvent,
|
|
}
|
|
logging.Log("SETUP-3N9fs").Info("default mail template/text set up")
|
|
return events, nil
|
|
}
|
|
return c.setup(ctx, step, fn)
|
|
}
|