mail

package
v0.0.0-...-c4f7e29 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	NewGomailDialer,
	NewLogger,
	wire.Struct(new(Sender), "*"),
)
View Source
var ErrMissingSMTPConfiguration = errors.New("mail: configuration is missing")

Functions

func MaskAddress

func MaskAddress(s string) string

MaskAddress masks the given email address, ignoring name.

func NewGomailDialer

func NewGomailDialer(smtp *config.SMTPServerCredentials) *gomail.Dialer

func SplitAddress

func SplitAddress(s string) (local string, domain string)

SplitAddress splits s into local part and domain.

Types

type Logger

type Logger struct{ *log.Logger }

func NewLogger

func NewLogger(lf *log.Factory) Logger

type SendOptions

type SendOptions struct {
	Sender    string
	ReplyTo   string
	Subject   string
	Recipient string
	TextBody  string
	HTMLBody  string
}

type Sender

type Sender struct {
	Logger                         Logger
	DevMode                        config.DevMode
	GomailDialer                   *gomail.Dialer
	FeatureTestModeEmailSuppressed config.FeatureTestModeEmailSuppressed
	TestModeEmailConfig            *config.TestModeEmailConfig
}

func (*Sender) Send

func (s *Sender) Send(opts SendOptions) (err error)

Jump to

Keyboard shortcuts

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