mail

package
v0.0.0-...-f83813f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

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
	GomailDialer *gomail.Dialer
}

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