email

package
v0.0.0-...-4ee5816 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context, squeue *ServiceQueue) context.Context

Context returns a context which includes the given mail worker.

func Middleware

func Middleware(squeue *ServiceQueue) echo.MiddlewareFunc

Middleware adds HTTP middleware to provide an email work queue to this context.

func NewQueue

func NewQueue() *work.Queue

NewQueue Creates a new email processing queue.

Types

type Attachment

type Attachment struct {
	// contains filtered or unexported fields
}

Attachment is a struct to pass in email attachments to a carrier email message.

type Helper

type Helper struct {
	IgnoreHTMLErrors bool
	CheckerLimit     int
	// contains filtered or unexported fields
}

Helper is a template wrapper for quickly sending emails Set IgnoreHTMLErrors to true if you don't want to worry about errors parsing html template. If any errors exist the html portion will not be attached to the email.

func NewHelper

func NewHelper(queue *ServiceQueue, tmap TMap, t *template.Template) *Helper

NewHelper returns a new email Helper

func (*Helper) Attach

func (h *Helper) Attach(fname string, data io.Reader, ctype string) error

Attach adds an email attachment

func (*Helper) Map

func (h *Helper) Map() TMap

Map ...

func (*Helper) Send

func (h *Helper) Send(name, from, rcpt string, data gobwebs.Map) error

Send sends the email

type ServiceQueue

type ServiceQueue struct {
	// contains filtered or unexported fields
}

ServiceQueue holds an email queue and service

func ForContext

func ForContext(ctx context.Context) *ServiceQueue

ForContext returns the email worker for this context.

func NewServiceQueue

func NewServiceQueue(logger echo.Logger, service carrier.Service,
	queue *work.Queue, checker gobwebs.MailChecker) *ServiceQueue

NewServiceQueue returns a new ServiceQueue instance

func (*ServiceQueue) Checker

func (s *ServiceQueue) Checker() gobwebs.MailChecker

Checker returns the mail checker

func (*ServiceQueue) Queue

func (s *ServiceQueue) Queue() *work.Queue

Queue returns the email service

func (*ServiceQueue) SendMail

func (s *ServiceQueue) SendMail(msg *carrier.Message) error

SendMail sends an email message

func (*ServiceQueue) Service

func (s *ServiceQueue) Service() carrier.Service

Service returns the email service

type TMap

type TMap map[string][]string

TMap is a template mapping map

Jump to

Keyboard shortcuts

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