mail

package
v0.0.0-...-d30cded Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Container = &MailerContainer{}
)

Initialize a mailer container singleton instance

Functions

func InitializeMailer

func InitializeMailer(config *settings.Config) error

InitializeMailer initializes the current mailer according to the config

Types

type DefaultMailer

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

DefaultMailer represents default mailer

func NewDefaultMailer

func NewDefaultMailer(smtpConfig *settings.SMTPConfig) (*DefaultMailer, error)

NewDefaultMailer returns a new default mailer

func (*DefaultMailer) SendMail

func (m *DefaultMailer) SendMail(message *MailMessage) error

SendMail sends an email according to argument

type MailMessage

type MailMessage struct {
	To      string
	Subject string
	Body    string
}

MailMessage represents an email entity

type Mailer

type Mailer interface {
	SendMail(message *MailMessage) error
}

Mailer is email sender interface

type MailerContainer

type MailerContainer struct {
	Current Mailer
}

MailerContainer contains the current mailer

func (*MailerContainer) SendMail

func (u *MailerContainer) SendMail(message *MailMessage) error

SendMail sends an email according to argument

Jump to

Keyboard shortcuts

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