email

package
v0.0.0-...-1ad4281 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmailDisabled empty from
	ErrEmailDisabled = errors.New("models/email.go: Error Email Disabled")
	// ErrNilFrom empty from
	ErrNilFrom = errors.New("models/email.go: Error Empty From")
	// ErrNilTo empty to
	ErrNilTo = errors.New("models/email.go: Error Empty To")
	// ErrNilSubject empty subject
	ErrNilSubject = errors.New("models/email.go: Error Empty Subject")
	// ErrNilBody empty body
	ErrNilBody = errors.New("models/email.go: Error Empty Body")
)

Functions

This section is empty.

Types

type Body

type Body struct {
	Plain string
	HTML  string
}

Body plain & html

type Config

type Config struct {
	// Enabled
	Enabled bool
	// Insecure skips tls cert verify
	Insecure bool
	// SMTP server
	Server string
	// SMTP username
	Username string
	// SMTP password
	Password string
	// Sender email
	Sender string
	// From email must not be == to Sender
	//
	// Format: name <email>
	From string
	// ReplyTo
	//
	// Format: name <email>
	ReplyTo string
}

Config for email server

type Email

type Email struct {
	// From overwrites config.From
	// (optional)
	//
	// Format: name <email>
	From string
	// ReplyTo overwrites config.ReplyTo
	// (optional)
	//
	// Format: name <email>
	ReplyTo string
	// To 1 or more emails
	To []string
	// Email subject
	Subject string
	// Email body
	Body Body
}

Email struct

func (*Email) Send

func (e *Email) Send(config *Config) error

Send email

func (*Email) SendChan

func (e *Email) SendChan(err chan error, config *Config)

SendChan channel send email

Jump to

Keyboard shortcuts

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