template

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSeedTemplate = "{{ .Frontmatter.subject }}||{{ .Content }}"

Variables

This section is empty.

Functions

func NewLetterTest added in v0.0.6

func NewLetterTest(
	fs fs.FS,
	p string,
) func(*testing.T)

func NewTemplateTest

func NewTemplateTest(tmpl Template) func(*testing.T)

Types

type Context

type Context struct {
	Frontmatter map[string]any
	Recipient   map[string]any
	Content     template.HTML
	Schedule    mdsend.Schedule
}

type Options

type Options struct {
	IdentifierGenerator mdsend.IdentifierGenerator
	ContentParser       parser.Parser
	RendererForText     renderer.Renderer
	RendererForHTML     renderer.Renderer
	Frontmatter         map[string]any
}

type Template

type Template interface {
	RenderLetterForRecipient(map[string]any) (mdsend.Message, error)
}

func New

func New(
	l mdsend.Letter,
	options Options,
) (_ Template, err error)

New creates a Template. The result is not safe for asynchronous rendering.

Jump to

Keyboard shortcuts

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