Help us shape the future of Go! Take the 2026 Go Developer Survey

email

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package email defines the transactional email sender interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

type Delivery int

Delivery is what became of a message the provider accepted.

const (
	// Pending means the provider is still trying.
	Pending Delivery = iota
	// Delivered means the recipient's mail system took the message.
	Delivered
	// Failed means the recipient's mail system refused the message, or the provider
	// gave up or cancelled it.
	Failed
)

type Message

type Message struct {
	To      string
	Subject string
	Text    string
}

Message is a plain-text email to one recipient.

type Sender

type Sender interface {
	// Send hands m to the provider and returns the provider's ID for it. A nil error
	// means the provider accepted the message, not that it arrived.
	Send(ctx context.Context, m Message) (id string, err error)
}

Sender sends transactional email, such as Scaleway Transactional Email.

type Tracker

type Tracker interface {
	// Delivery returns the state of the message with the given ID and, once it was
	// delivered, when.
	Delivery(ctx context.Context, id string) (Delivery, time.Time, error)
}

Tracker reports what became of messages, for providers that can tell.

type TrackingSender

type TrackingSender interface {
	Sender
	Tracker
}

TrackingSender sends messages and reports their delivery. Anything that must know a message arrived, such as a warning before credit expires, needs one.

Directories

Path Synopsis
Package scaleway sends email through Scaleway Transactional Email.
Package scaleway sends email through Scaleway Transactional Email.

Jump to

Keyboard shortcuts

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