mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-07 03:52:10 +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:
31
internal/org/repository/eventsourcing/model/mail_template.go
Normal file
31
internal/org/repository/eventsourcing/model/mail_template.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
es_models "github.com/caos/zitadel/internal/eventstore/models"
|
||||
iam_es_model "github.com/caos/zitadel/internal/iam/repository/eventsourcing/model"
|
||||
)
|
||||
|
||||
func (o *Org) appendAddMailTemplateEvent(event *es_models.Event) error {
|
||||
o.MailTemplate = new(iam_es_model.MailTemplate)
|
||||
err := o.MailTemplate.SetDataLabel(event)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
o.MailTemplate.ObjectRoot.CreationDate = event.CreationDate
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Org) appendChangeMailTemplateEvent(event *es_models.Event) error {
|
||||
mailTemplate := &iam_es_model.MailTemplate{}
|
||||
err := mailTemplate.SetDataLabel(event)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
mailTemplate.ObjectRoot.ChangeDate = event.CreationDate
|
||||
o.MailTemplate = mailTemplate
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Org) appendRemoveMailTemplateEvent(event *es_models.Event) {
|
||||
o.MailTemplate = nil
|
||||
}
|
||||
Reference in New Issue
Block a user