mailkit

package module
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package mailkit renders application mail and declares the seam that sends it.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRecipient = errors.New("mailkit: invalid recipient")

ErrInvalidRecipient reports an address the transport refuses.

View Source
var ErrNoRecipient = errors.New("mailkit: no recipient")

ErrNoRecipient reports a message whose To is empty.

View Source
var ErrNoSubject = errors.New("mailkit: no subject")

ErrNoSubject reports a template whose rendered output is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	To      string
	Subject string
	Body    string
}

Message is one mail to one recipient.

type Sender

type Sender interface {
	// Send delivers m, answering ErrNoRecipient, ErrInvalidRecipient,
	// or a wrapped delivery error.
	Send(ctx context.Context, m Message) error
}

Sender delivers one message.

type Templates

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

Templates renders mail from template files, preferring an override directory.

func NewTemplates

func NewTemplates(defaults fs.FS, overrideDir string) (*Templates, error)

NewTemplates returns Templates over the caller's default files and an optional override directory.

func (*Templates) Render

func (t *Templates) Render(name string, data any) (Message, error)

Render executes the named template with data, answering a Message whose To the caller fills.

Directories

Path Synopsis
Package smtp delivers mailkit messages over SMTP.
Package smtp delivers mailkit messages over SMTP.
Package testkit provides test doubles for mailkit consumers.
Package testkit provides test doubles for mailkit consumers.

Jump to

Keyboard shortcuts

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