email

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email interface {
	SendSimple(from, to, subject, content string) error
	Send(from string, to []string, subject, templateFilename string, content map[string]any) error
	SendWithAttachment(from string, to []string, subject, templateFilename string, content map[string]any, r io.Reader, filename string, contentType string) error
}

func NewMock

func NewMock() Email

func NewSmtpEmail

func NewSmtpEmail(address string, identity, username, password, host string) Email

type Mock

type Mock struct {
}

func (Mock) Send

func (m Mock) Send(from string, to []string, subject, templateFilename string, content map[string]any) error

func (Mock) SendSimple

func (m Mock) SendSimple(from, to, subject, content string) error

func (Mock) SendWithAttachment

func (m Mock) SendWithAttachment(from string, to []string, subject, templateFilename string, content map[string]any, r io.Reader, filename string, contentType string) error

type SmtpEmail

type SmtpEmail struct {
	Address string
	Auth    smtp.Auth
}

func (SmtpEmail) Send

func (s SmtpEmail) Send(from string, to []string, subject, templateFilename string, content map[string]any) error

func (SmtpEmail) SendSimple

func (s SmtpEmail) SendSimple(from, to, subject, content string) error

func (SmtpEmail) SendWithAttachment

func (s SmtpEmail) SendWithAttachment(from string, to []string, subject, templateFilename string, content map[string]any, r io.Reader, filename string, contentType string) error

Jump to

Keyboard shortcuts

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