mail

package
v0.0.0-...-0b10b3f Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWorkerAlreadyRunning error = errors.New("worker is already running")
	ErrMailerNotInitialized error = errors.New("mailer not initialized")
	ErrNoPreferenceService  error = errors.New("no preference service assigned <nil>")
)

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	Queue chan *echosight.Result

	Opts
	// contains filtered or unexported fields
}

func New

func New(opts Opts) (*Mailer, error)

func (*Mailer) Enabled

func (m *Mailer) Enabled() bool

func (*Mailer) Send

func (m *Mailer) Send(ctx context.Context, result *echosight.Result) error

func (*Mailer) SendTemplate

func (m *Mailer) SendTemplate(templateFile string, data any) error

func (*Mailer) Stop

func (m *Mailer) Stop() error

type Opts

type Opts struct {
	AppPreferences echosight.PreferenceService
	Recipients     echosight.RecipientService
	Crypter        echosight.Crypter
}

type SMTPConfig

type SMTPConfig struct {
	Sender        string `mapstructure:"smtp_sender"`
	Host          string `mapstructure:"smtp_host"`
	Port          string `mapstructure:"smtp_port"`
	User          string `mapstructure:"smtp_user"`
	Enabled       bool   `mapstructure:"smtp_enabled"`
	PasswordCrypt string `mapstructure:"smtp_password_crypt"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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