mailer

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mailer sends ReputeCast's own system mail (password resets, team invites, double opt-in, approval notifications) through whichever sending provider is routed to the System stream. Until one is connected every flow that would email has a fallback (copy a link, run a CLI command).

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSystemProvider = errors.New("no sending provider is connected to the System stream")

ErrNoSystemProvider means no provider is connected to the System stream yet.

Functions

This section is empty.

Types

type Message

type Message struct {
	WorkspaceID *uuid.UUID
	To          string
	ToName      string
	Subject     string
	Text        string
	HTML        string
	// Kind tags the message for logs and the event timeline ("password_reset", "invite").
	Kind string
	// Lang is the language of the layout around the body (why it was sent,
	// who sent it): the member's app language for team mail. English when
	// unset.
	Lang i18n.Lang
}

Message is one system email.

type Sender

type Sender interface {
	SendSystem(ctx context.Context, m Message) (provider string, err error)
	// SystemAvailable reports whether a System-stream provider exists, so the
	// UI can offer copyable links before trying to send.
	SystemAvailable(ctx context.Context, workspaceID *uuid.UUID) bool
}

Sender delivers system mail. It returns the name of the provider used.

type Unavailable

type Unavailable struct{}

Unavailable is the Sender used when no provider can send system mail.

func (Unavailable) SendSystem

func (Unavailable) SendSystem(context.Context, Message) (string, error)

SendSystem always fails with ErrNoSystemProvider.

func (Unavailable) SystemAvailable

func (Unavailable) SystemAvailable(context.Context, *uuid.UUID) bool

SystemAvailable always reports false.

Jump to

Keyboard shortcuts

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