email

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderEmailChangeCodeHTML added in v0.1.15

func RenderEmailChangeCodeHTML(code string) (string, error)

func RenderPasswordResetCodeHTML added in v0.1.14

func RenderPasswordResetCodeHTML(code string) (string, error)

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 BuildEmailChangeCodeMessage added in v0.1.15

func BuildEmailChangeCodeMessage(code string) (Message, error)

func BuildPasswordResetCodeMessage added in v0.1.14

func BuildPasswordResetCodeMessage(code string) (Message, error)

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