mail

package
v0.0.0-...-7268f2b Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 4 Imported by: 1 module, 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

func Address

func Address(name, email string) *address

func Addresses

func Addresses[S sender](addresses ...S) addressSlice

func Attachment

func Attachment(options ...attachmentOption) attachment

func Register

func Register[T Mailer](templates embed.FS, service T) T

func Send

func Send[S sender](context context.Context, email S, opts ...option) error

func WithContent

func WithContent(content []byte) attachmentOption

func WithMailable

func WithMailable(mailable Mailablee) option

func WithMime

func WithMime(mime string) attachmentOption

func WithName

func WithName(name string) attachmentOption

Types

type AttachmentSlice

type AttachmentSlice []attachment

func Attachments

func Attachments(attachments ...attachment) AttachmentSlice

type Content

type Content struct {
	View string
	With With
}

type Envelope

type Envelope struct {
	From    *address
	To      addressSlice
	Cc      addressSlice
	Bcc     addressSlice
	ReplyTo *address
	Subject string
}

type Mailable

type Mailable[M Mailablee] struct {
	Mailer M
}

func (Mailable[M]) Send

func (m Mailable[M]) Send(context context.Context, email string) error

type Mailablee

type Mailablee interface {
	Envelope() Envelope
	Content() Content
	Attachments() AttachmentSlice
}

type Mailer

type Mailer interface {
	Register(templates embed.FS) Mailer
	Send(context context.Context, options Options) error
}

type Options

type Options struct {
	ID          string
	Envelope    Envelope
	Content     Content
	Attachments AttachmentSlice
}

type With

type With map[string]any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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