email

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendSMTP

func SendSMTP(opts *options.EmailOptions, to, subject, body string) (err error)

SendSMTP is a helper to send email via SMTP, used by both Sync and Async senders

Types

type AsyncSender

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

AsyncSender implements Sender interface using Redis Queue

func NewAsyncSender

func NewAsyncSender(c cache.Cache, opts *options.EmailOptions, queueKey string) *AsyncSender

NewAsyncSender creates a new AsyncSender with Redis backend

func (*AsyncSender) Close

func (s *AsyncSender) Close()

func (*AsyncSender) Send

func (s *AsyncSender) Send(ctx context.Context, to, subject, body string) error

type SMTPSender

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

SMTPSender implements Sender using direct SMTP

func NewSMTPSender

func NewSMTPSender(opts *options.EmailOptions) *SMTPSender

NewSMTPSender creates a new SMTPSender

func (*SMTPSender) Close

func (s *SMTPSender) Close()

func (*SMTPSender) Send

func (s *SMTPSender) Send(ctx context.Context, to, subject, body string) error

type Sender

type Sender interface {
	Send(ctx context.Context, to, subject, body string) error
	Close()
}

Sender defines the interface for sending emails

Jump to

Keyboard shortcuts

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