email

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripHTMLRegex

func StripHTMLRegex(s string) string

Types

type ErrorService

type ErrorService struct{}

ErrorService always return an error when sending an email

func (ErrorService) Send

func (e ErrorService) Send(_ context.Context, _ Mail) error

type LogService

type LogService struct {
	Logger *log.Logger
}

LogService logs the email to a *log.Logger

func (LogService) Send

func (l LogService) Send(_ context.Context, m Mail) error

type Mail

type Mail struct {
	Recipients []string
	Subject    string
	Message    string
}

Mail represents an email

type SMTPService

type SMTPService struct {
	From     string
	Host     string
	Port     int
	User     string
	Password string
}

SMTPService sends an email via SMTP

func (SMTPService) Send

func (s SMTPService) Send(ctx context.Context, mail Mail) error

type SendgridService

type SendgridService struct {
	SenderName    string
	SenderAddress string
	APIKey        string
}

SendgridService sends and email via the Sendgrid API

func (SendgridService) Send

func (s SendgridService) Send(ctx context.Context, m Mail) error

type Service

type Service interface {
	Send(ctx context.Context, m Mail) error
}

Service sends and email

Jump to

Keyboard shortcuts

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