notifications

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: AGPL-3.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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