emailkit

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPrimary      = "#8e44ad"
	DefaultPrimaryHover = "#732d91"
	DefaultText         = "#2c3e50"
	DefaultMutedText    = "#64748b"
	DefaultCardBG       = "#ffffff"
	DefaultBorder       = "#e2e8f0"
	DefaultBackground   = "#f4f6f8"
	DefaultSuccess      = "#10b981"
	DefaultWarning      = "#f59e0b"
	DefaultError        = "#ef4444"
)

Variables

This section is empty.

Functions

func ContrastText

func ContrastText(bg string) string

func Funcs

func Funcs(th Theme) template.FuncMap
func Link(href, text string) template.HTML

func ParseFS

func ParseFS(th Theme, fsys fs.FS, file string, extra ...template.FuncMap) (*template.Template, error)

func Render

func Render(t *template.Template, data any, th Theme, p Page) (string, error)

func SafeColor

func SafeColor(v, fallback string) string

func Wrap

func Wrap(th Theme, p Page, body template.HTML) template.HTML

Types

type Overrides

type Overrides struct {
	BrandName    string
	LogoURL      string
	Primary      string
	PrimaryHover string
	Text         string
	MutedText    string
	CardBG       string
	Border       string
	Background   string
	Success      string
	Warning      string
	Error        string
	Info         string
}

type Page

type Page struct {
	Lang      string
	Title     string
	Rights    string
	Footer    template.HTML
	BrandURL  string
	PoweredBy template.HTML
	Year      int
}

type Theme

type Theme struct {
	BrandName    string
	LogoURL      string
	Primary      string
	PrimaryHover string
	Text         string
	MutedText    string
	CardBG       string
	Border       string
	Background   string
	ButtonText   string
	Success      string
	Warning      string
	Error        string
	Info         string
}

func Merchant

func Merchant(platformBrand string, o Overrides) Theme

func Platform

func Platform(brand string) Theme

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL