zitadel/internal/command/setup_step13.go
Max Peintner 057537cc82
feat(notification): new mail templates (#1579)
* fix: new template light only

* add border radius to img

* system first font, font weight

* fix: change email template

* fix: go mod

* update ref

* fix: template

Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
2021-04-16 14:55:55 +02:00

33 lines
844 B
Go

package command
import (
"context"
"github.com/caos/logging"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/eventstore"
)
type Step13 struct {
DefaultMailTemplate domain.MailTemplate
}
func (s *Step13) Step() domain.Step {
return domain.Step13
}
func (s *Step13) execute(ctx context.Context, commandSide *Commands) error {
return commandSide.SetupStep13(ctx, s)
}
func (c *Commands) SetupStep13(ctx context.Context, step *Step13) error {
fn := func(iam *IAMWriteModel) ([]eventstore.EventPusher, error) {
_, mailTemplateEvent, err := c.changeDefaultMailTemplate(ctx, &step.DefaultMailTemplate)
if err != nil {
return nil, err
}
logging.Log("SETUP-4insR").Info("default mail template/text set up")
return []eventstore.EventPusher{mailTemplateEvent}, nil
}
return c.setup(ctx, step, fn)
}