email

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderSignupCodeHTML

func RenderSignupCodeHTML(code string) (string, error)

Types

type LoginAlertPayload

type LoginAlertPayload struct {
	V          int       `json:"v"`
	IPAddress  string    `json:"ip_address"`
	LoggedInAt time.Time `json:"logged_in_at"`
	UserAgent  string    `json:"user_agent,omitempty"`
}

type Message

type Message struct {
	Subject string
	Text    string
	HTML    string
}

func BuildSignupCodeMessage

func BuildSignupCodeMessage(code string) (Message, error)

type NoopSender

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

func NewNoopSender

func NewNoopSender(cfg NoopSenderConfig) *NoopSender

func (*NoopSender) Send

func (s *NoopSender) Send(ctx context.Context, to string, msg Message) error

type NoopSenderConfig

type NoopSenderConfig struct {
	Logger *slog.Logger
}

type SMTPSender

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

func NewSMTPSender

func NewSMTPSender(
	host string,
	port int,
	username string,
	password string,
	from string,
	useTLS bool,
	timeout time.Duration,
) *SMTPSender

func (*SMTPSender) Send

func (s *SMTPSender) Send(ctx context.Context, to string, msg Message) error

type Sender

type Sender interface {
	Send(ctx context.Context, to string, msg Message) error
}

type Service

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

func NewService

func NewService(sender Sender) *Service

func (*Service) Send

func (s *Service) Send(ctx context.Context, to string, msg Message) error

Jump to

Keyboard shortcuts

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