mail

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer interface {
	Send(ctx context.Context, msg Message) error
}

type Message

type Message struct {
	To      []string
	Subject string
	Body    string
	HTML    string
}

type NoopMailer

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

func NewNoopMailer

func NewNoopMailer() *NoopMailer

func (*NoopMailer) Send

func (m *NoopMailer) Send(_ context.Context, msg Message) error

func (*NoopMailer) Sent

func (m *NoopMailer) Sent() []Message

type Renderer

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

Renderer renders HTML email bodies from named templates with automatic HTML escaping (html/template).

func NewRenderer

func NewRenderer(templates map[string]string) (*Renderer, error)

NewRenderer parses the given named templates (name -> template source).

func (*Renderer) Render

func (r *Renderer) Render(name string, data any) (string, error)

Render executes the named template with data and returns the rendered HTML.

type SMTPMailer

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

func NewSMTPMailer

func NewSMTPMailer(host string, port int, user, pass, from string) *SMTPMailer

func (*SMTPMailer) Send

func (m *SMTPMailer) Send(_ context.Context, msg Message) error

Jump to

Keyboard shortcuts

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