notifications

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailSender

type EmailSender interface {
	SendEmail(to, subject, body string) error
}

type MailService

type MailService struct {
	FromEmail string
	SMTPHost  string
	SMTPPort  int
	Username  string
	Password  string
	Mailer    Mailer
	DevMode   bool
}

func NewMailService

func NewMailService(fromEmail, smtpHost string, smtpPort int, username, password string, mailer Mailer, devMode bool) *MailService

func NewTestMailService

func NewTestMailService() *MailService

NewTestMailService creates a new MailService configured for testing

func (*MailService) SendEmail

func (m *MailService) SendEmail(to, subject, body string) error

type Mailer

type Mailer interface {
	DialAndSend(m ...*mail.Message) error
}

type TestEmail

type TestEmail struct {
	From    string
	To      string
	Subject string
	Body    string
	SentAt  time.Time
}

TestEmail represents an email captured during testing

type TestMailer

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

TestMailer implements the Mailer interface for testing purposes

func NewTestMailer

func NewTestMailer() *TestMailer

NewTestMailer creates a new TestMailer instance

func (*TestMailer) ClearEmails

func (m *TestMailer) ClearEmails()

ClearEmails removes all stored emails

func (*TestMailer) DialAndSend

func (m *TestMailer) DialAndSend(msgs ...*mail.Message) error

DialAndSend implements the Mailer interface by storing the email for later verification

func (*TestMailer) GetEmails

func (m *TestMailer) GetEmails() []TestEmail

GetEmails returns all emails that have been "sent" through this mailer

Jump to

Keyboard shortcuts

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