delivery

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package delivery sends rendered reports to recipients. Email (SMTP) is the only channel today; the Deliverer interface keeps file/webhook channels drop-in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deliverer

type Deliverer interface {
	Deliver(ctx context.Context, tenant string, to []string, subject string, html, pdf []byte) error
}

Deliverer sends one tenant's rendered report to its recipients.

type SMTP

type SMTP struct {
	// contains filtered or unexported fields
}

SMTP delivers reports as email (HTML body + PDF attachment) via go-mail.

func NewSMTP

func NewSMTP(cfg config.SMTP) (*SMTP, error)

NewSMTP builds an SMTP deliverer from config. STARTTLS is mandatory when cfg.StartTLS is set (port 587 style); otherwise TLS is disabled (e.g. a local demo sink). Auth is enabled only when a username is configured.

func (*SMTP) Deliver

func (s *SMTP) Deliver(ctx context.Context, tenant string, to []string, subject string, html, pdf []byte) error

Deliver composes and sends the email.

Jump to

Keyboard shortcuts

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