mailman

package
v0.0.0-...-2c24670 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TemplateDir string
	Templates   map[string]*Template
)

Functions

func AddTemplate

func AddTemplate(key string, subject string, htmlBody string, plainBody string) error

func Configure

func Configure(m Mailer)

func RegisterTemplate

func RegisterTemplate(keys ...string) error

func Send

func Send(to *Address, templateKey string, vars *MergeVars) error

Types

type Address

type Address struct {
	Name  string
	Email string
}

type Config

type Config struct {
	From   *Address
	Domain string
}

type Content

type Content struct {
	Subject   *bytes.Buffer
	HtmlBody  *bytes.Buffer
	PlainBody *bytes.Buffer
}

type Mailer

type Mailer interface {
	Config() *Config
	Send(to *Address, content *Content, vars *MergeVars) error
}

type MergeVars

type MergeVars struct {
	SubjectVars map[string]string
	BodyVars    map[string]string
}

type Template

type Template struct {
	Subject   *template.Template
	HtmlBody  *template.Template
	PlainBody *template.Template
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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