email

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package email defines the stable core email port.

Message is the provider-neutral payload shape used by outbound email senders. Sender is intentionally narrow so applications can adapt Resend, SMTP, test, or no-op delivery without depending on a provider package from the stable core module.

Purpose: See the package summary above. Import: `github.com/aatuh/api-toolkit/v4/email`. Example: See docs/api-reference.md for package example links and docs/cookbook.md for task recipes. Errors: Constructors, parsers, and handlers return or write documented errors according to their signatures; packages with plain data types do not add hidden error channels. Concurrency: Treat configured middleware and helpers as immutable after construction; request and response values remain request-scoped unless a type documents stronger guarantees. Stability: Stable core API under VERSIONING.md and scripts/apicheck.sh. When not to use: Prefer net/http, application-owned types, or narrower helpers when this package contract is not needed.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	From    string
	To      []string
	ReplyTo string
	Subject string
	Text    string
	HTML    string
}

Message is a provider-agnostic email payload.

Example
package main

import (
	"fmt"

	"github.com/aatuh/api-toolkit/v4/email"
)

func main() {
	message := email.Message{
		From:    "support@example.test",
		To:      []string{"user@example.test"},
		Subject: "Welcome",
		Text:    "Thanks for signing up.",
	}

	fmt.Println(message.To[0])
	fmt.Println(message.Subject)

}
Output:
user@example.test
Welcome

type Sender

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

Sender delivers outbound email messages.

Jump to

Keyboard shortcuts

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