rmailer

package
v0.0.0-...-7578c0e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxHangingMailSends = 20

Variables

This section is empty.

Functions

func NewConsumer

func NewConsumer(mailer Mailer, l *logger.Logger) *consumer

func WrapWithTemplate

func WrapWithTemplate(content string) (string, error)

Types

type AuthType

type AuthType string
const (
	AuthTypeNone     AuthType = "none"
	AuthTypeUserPass AuthType = "user-pass"
)

List of common content types

type AuthUserPass

type AuthUserPass struct {
	User string
	Pass string
}

type Config

type Config struct {
	Host         string
	Port         int
	Domain       string
	From         string
	TLS          bool
	AuthType     AuthType
	AuthUserPass AuthUserPass
	NoNoop       bool
}

func ConfigFromSMTPConfig

func ConfigFromSMTPConfig(config chconfig.SMTPConfig) (Config, error)

type ContentType

type ContentType string

ContentType represents a content type for the Msg

const (
	ContentTypeTextPlain ContentType = "text/plain"
	ContentTypeTextHTML  ContentType = "text/html"
)

List of common content types

func (ContentType) Valid

func (t ContentType) Valid() error

type Mailer

type Mailer interface {
	Send(ctx context.Context, to []string, subject string, contentType ContentType, body string) error
}

func NewRMailer

func NewRMailer(config Config, l *logger.Logger) Mailer

type ReceivedMail

type ReceivedMail struct {
	smtpmock.Message
}

func (ReceivedMail) GetContent

func (r ReceivedMail) GetContent() string

func (ReceivedMail) GetContentType

func (r ReceivedMail) GetContentType() string

func (ReceivedMail) GetSubject

func (r ReceivedMail) GetSubject() string

func (ReceivedMail) GetTo

func (r ReceivedMail) GetTo() []string

Jump to

Keyboard shortcuts

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