emailtemplate

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentYear

func CurrentYear() int

func FormatDuration

func FormatDuration(d time.Duration) string

func Lower

func Lower(s string) string

func Plural

func Plural(s string, count int) string

func Title

func Title(s string) string

func Upper

func Upper(s string) string

Types

type CommonContext

type CommonContext struct {
	AppName string
	BaseURL string
}

func NewCommonContext

func NewCommonContext(appName, baseURL string) CommonContext

type Definition

type Definition struct {
	Name    string
	Subject string
	Text    string
	HTML    string
}

type EmailTemplate

type EmailTemplate struct {
	// contains filtered or unexported fields
}

func (*EmailTemplate) Execute

func (et *EmailTemplate) Execute(data any) (subject, text, html string, err error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) Register

func (m *Manager) Register(def Definition) error

func (*Manager) Render

func (m *Manager) Render(name string, data any) (subject, text, html string, err error)

Jump to

Keyboard shortcuts

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