mail

package
v0.0.0-...-baf35ca Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmailNotConfigured = errors.New("email not configured")

Functions

func Configured

func Configured() bool

func Initialize

func Initialize(cfg Config, l zerolog.Logger) error

func SendPasswordResetEmail

func SendPasswordResetEmail(u core.User, token string) error

func SendResourceShareEmail

func SendResourceShareEmail(u core.User, r core.Resource) error

func SendTokenLoginEmail

func SendTokenLoginEmail(u core.User, token string) error

func SendWelcomeEmail

func SendWelcomeEmail(u core.User) error

Types

type Config

type Config struct {
	SMTP     SMTPConfig `koanf:"smtp"`
	From     FromConfig `koanf:"from"`
	Instance string     `koanf:"instance"`
}

type Email

type Email struct {
	Subject *template.Template
	Plain   *template.Template
	HTML    *template.Template
}

type FromConfig

type FromConfig struct {
	Name  string `koanf:"name"`
	Email string `koanf:"email"`
}

type SMTPConfig

type SMTPConfig struct {
	Host     string `koanf:"host"`
	Port     int    `koanf:"port"`
	Username string `koanf:"username"`
	Password string `koanf:"password"`
}

Jump to

Keyboard shortcuts

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