mailer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package mailer sends email through blackhole, SMTP, AWS SES v2, or Resend backends and includes helpers for verification links.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr() string

Addr returns a human-readable address for the configured backend.

func BuildVerifyURL

func BuildVerifyURL(base, path, token string) (string, error)

BuildVerifyURL builds a verification link.

func Close

func Close()

Close releases mailer resources.

func Init

func Init(from, smtpAddr, smtpUsername, smtpPassword, region, resendAPIKey, resendAPIBaseURL string)

Init configures the process-wide mailer backend.

Exactly one delivery backend may be configured: SMTP via smtpAddr, AWS SES via region, or Resend via resendAPIKey. With no backend and no from address, the mailer uses the blackhole backend.

func IsBlackhole

func IsBlackhole() bool

IsBlackhole reports whether the blackhole backend is active.

func LastError

func LastError() string

LastError returns the last backend error recorded by Send.

func Send

func Send(ctx context.Context, to, subject, text, html string) error

Send sends an email using the currently configured backend.

func UseBlackHole

func UseBlackHole()

UseBlackHole switches delivery to the blackhole backend.

Types

This section is empty.

Jump to

Keyboard shortcuts

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