template

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Subject string
	Body    string
}

Email represents a rendered email ready to send

type EmailData

type EmailData struct {
	// User profile
	FirstName      string
	LastName       string
	FullName       string
	Email          string
	OtherEmails    string // comma-separated additional emails, empty if none
	OtherNames     string // comma-separated name variants, empty if none
	OtherAddresses string // semicolon-separated previous addresses, empty if none
	Address        string
	City           string
	State          string
	ZipCode        string
	Country        string
	Phone          string
	OtherPhones    string // comma-separated additional phone numbers, empty if none
	DateOfBirth    string

	// Broker info
	BrokerName    string
	BrokerEmail   string
	BrokerWebsite string
	BrokerOptOut  string

	// Metadata
	Date     string
	Year     int
	Month    string
	Template string
}

EmailData contains all data available to email templates

type Engine

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

Engine handles email template rendering

func NewEngine

func NewEngine() (*Engine, error)

NewEngine creates a new template engine

func (*Engine) Render

func (e *Engine) Render(templateName string, profile config.Profile, b broker.Broker) (*Email, error)

Render generates an email from a template

Jump to

Keyboard shortcuts

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