package main
import (
"fmt"
"git.dev.alexdunmow.com/block/core/templates"
)
// scifiEmailBgColor / scifiEmailCardColor / scifiEmailBorderColor pull from the
// caller-provided EmailColors so the wrapper inherits the active preset.
func scifiEmailBgColor(c templates.EmailContext) string {
if c.Colors.Background != "" {
return c.Colors.Background
}
return "#F6F7F8"
}
func scifiEmailCardColor(c templates.EmailContext) string {
if c.Colors.Card != "" {
return c.Colors.Card
}
return "#FFFFFF"
}
func scifiEmailBorderColor(c templates.EmailContext) string {
if c.Colors.Border != "" {
return c.Colors.Border
}
return "#D6D9DD"
}
func scifiEmailFgColor(c templates.EmailContext) string {
if c.Colors.Foreground != "" {
return c.Colors.Foreground
}
return "#16202E"
}
func scifiEmailMutedColor(c templates.EmailContext) string {
if c.Colors.MutedForeground != "" {
return c.Colors.MutedForeground
}
return "#5C6776"
}
func scifiEmailCallsign(c templates.EmailContext) string {
if c.SiteSettings.SiteName != "" {
return "SCF / " + c.SiteSettings.SiteName
}
return "SCF-CLN"
}
// scifiEmailTemplate is the Sci-Fi Clean branded email wrapper.
templ scifiEmailTemplate(emailCtx templates.EmailContext, body string) {
{ emailCtx.SiteSettings.SiteName }
if emailCtx.PreviewText != "" {
{ emailCtx.PreviewText }
}
|
{ emailCtx.SiteSettings.SiteName }
|
{ scifiEmailCallsign(emailCtx) }
|
|
|
@templ.Raw(body)
|
|
{ emailCtx.SiteSettings.SiteURL }
|
if emailCtx.UnsubscribeURL != "" {
Unsubscribe
|
}
|
|
}