mail

package
v0.18.1 Latest Latest
Warning

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

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

Documentation

Overview

Package mail sends transactional email (password-reset links and platform announcements) via a configured SMTP relay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendAnnouncementEmail

func SendAnnouncementEmail(cfg Config, to, subject, markdownBody string) error

SendAnnouncementEmail sends a platform announcement's translated body (markdown, per Announcement.Translations) to to, rendered to HTML. subject is caller-supplied — an announcement has no user-facing title of its own (Announcement.Name is an admin-only label, never shown to end users), so callers should pass a generic subject rather than Name. Returns an error when cfg.Host is empty (SMTP not configured), the markdown fails to render, or the send itself fails; callers are expected to treat a failure as "not sent" and retry on a later tick rather than swallowing it permanently.

func SendPasswordResetEmail

func SendPasswordResetEmail(cfg Config, to, confirmURL string) error

SendPasswordResetEmail sends a password-reset confirmation link to to. Returns an error when cfg.Host is empty (SMTP not configured) or the send itself fails; callers are expected to log-and-swallow per RequestPasswordReset's contract.

Types

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	Password string
	From     string
}

Config is the minimal SMTP relay configuration needed to send mail.

Jump to

Keyboard shortcuts

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