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.
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 ¶
Attach adds an email attachment
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