mail

package
v0.0.0-...-b84af7b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRecipients = errors.New("Invalid recipients.")

Functions

This section is empty.

Types

type InboundMail

type InboundMail struct {
	Id        bson.ObjectId `bson:"_id,omitempty" json:"id"`
	MessageId string        `bson:"messageid" json:"message_id"`
	Created   time.Time     `bson:"created_at" json:"created_at"`
}

type Mail

type Mail struct {
	MailBase
	Template int
}

type MailBase

type MailBase struct {
	Subject   string
	Recipient []MailRecipient
	Variables map[string]interface{}
	FromName  string
	FromEmail string
}

func (MailBase) From

func (mail MailBase) From() *core.Address

func (MailBase) SubjectText

func (mail MailBase) SubjectText() string

func (MailBase) To

func (mail MailBase) To() []*core.Address

type MailRecipient

type MailRecipient struct {
	Name  string
	Email string
}

type Mailable

type Mailable interface {
	From() *core.Address
	To() []*core.Address
	SubjectText() string
}

type Mailer

type Mailer interface {
	Send(Mail) string
	SendRaw(Raw) string
}

type ModuleConfig

type ModuleConfig struct {
	From           string
	FromName       string
	Recipients     []string
	IgnoredDomains []string
}

type PostmarkMailer

type PostmarkMailer struct {
	Logger *logging.Logger
	Client *postmark.Client
	// contains filtered or unexported fields
}

func Postmark

func Postmark(config *config.Config, logger *logging.Logger) (PostmarkMailer, error)

func (PostmarkMailer) IsSafe

func (m PostmarkMailer) IsSafe(email string) bool

func (PostmarkMailer) Send

func (module PostmarkMailer) Send(m Mail) string

func (PostmarkMailer) SendRaw

func (module PostmarkMailer) SendRaw(raw Raw) string

type Raw

type Raw struct {
	MailBase
	Content io.Reader
}

type TestMailer

type TestMailer struct {
	Logger *logging.Logger
}

func (TestMailer) Send

func (t TestMailer) Send(mail Mail) string

func (TestMailer) SendRaw

func (t TestMailer) SendRaw(raw Raw) string

Jump to

Keyboard shortcuts

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