template-monorepo/internal/model/notification/domain/template/spec.go

28 lines
788 B
Go

package template
// Spec defines how a notification kind is rendered for one locale.
// Prefer EmailSubjectFile / EmailBodyFile / SMSTextFile (go:embed) over inline strings.
type Spec struct {
RequiredVars []string
// Embedded asset paths (relative to template package), e.g. "html/verify_email.zh-tw.html".
EmailSubjectFile string
EmailBodyFile string
SMSTextFile string
// Inline fallbacks (optional); used when *File fields are empty.
EmailSubject string
EmailBody string
SMSText string
// EmailProviderTemplateID is optional (e.g. SendGrid dynamic template); future use.
EmailProviderTemplateID string
}
// Rendered is the output passed to email/SMS providers.
type Rendered struct {
Subject string
Body string // HTML for email
SMSText string
}