package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/templates" ) // KindergartenEmailWrapper wraps email body content in a Kindergarten-branded // rounded card. Uses a centered 600px table with a 32px border-radius card for // clients that support it; Outlook degrades gracefully to a square card. func KindergartenEmailWrapper(body string, emailCtx templates.EmailContext) string { var buf bytes.Buffer _ = kindergartenEmailTemplate(emailCtx, body).Render(context.Background(), &buf) return buf.String() } // kgEmailColor returns the supplied hex color or the cream/foreground/etc. // fallback when the engine has not resolved a value for the token. func kgEmailColor(value, fallback string) string { if value != "" { return value } return fallback } // kgEmailBg / etc. group fallbacks for the cream/navy palette per spec ยง10. func kgEmailBg(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.Background, "#fdf9ed") } func kgEmailCard(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.Card, "#ffffff") } func kgEmailFg(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.Foreground, "#1a253b") } func kgEmailMuted(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.MutedForeground, "#5a6480") } func kgEmailAccent(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.Primary, "#fbcd1f") } func kgEmailAccentFg(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.PrimaryForeground, "#1a253b") } func kgEmailBorder(ctx templates.EmailContext) string { return kgEmailColor(ctx.Colors.Border, "#e6d9b3") }