mailer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopMailer

type NoopMailer struct{}

NoopMailer is a domain.Mailer implementation that discards all emails. Use in unit tests and local development.

func NewNoopMailer

func NewNoopMailer() *NoopMailer

NewNoopMailer constructs a NoopMailer.

func (*NoopMailer) SendOTP

func (n *NoopMailer) SendOTP(_ context.Context, _, _ string) error

SendOTP is a no-op implementation of domain.Mailer.

type SMTPMailer

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

SMTPMailer implements domain.Mailer via net/smtp.

func NewSMTPMailer

func NewSMTPMailer(host string, port int, username, password, from string) (*SMTPMailer, error)

NewSMTPMailer constructs an SMTPMailer. Returns an error if required fields are empty.

func (*SMTPMailer) SendOTP

func (m *SMTPMailer) SendOTP(ctx context.Context, to, code string) error

SendOTP sends the OTP code to the recipient via SMTP.

Jump to

Keyboard shortcuts

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