queue

package
v0.0.0-...-3890dee Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveResults

func SaveResults[T mailer.CSVData](data []*T, filename string) (err error)

Types

type OptFunc

type OptFunc func(*Queue) error

OptFunc represents a function type for configuring a Queue.

func WithHTML

func WithHTML(file string) OptFunc

WithHTML sets the HTML content for the emails to be sent by the Queue.

func WithRateDaily

func WithRateDaily(rate uint16) OptFunc

WithRateDaily sets the maximum number of emails that can be sent by a single sender in a day.

func WithRateMinute

func WithRateMinute(rate uint16) OptFunc

WithRateMinute sets the maximum number of emails that can be sent by a single sender in a minute.

func WithReadReceipts

func WithReadReceipts(e string) OptFunc

WithReadReceipts sets the email address which is to receive the "Read receipt" notifications from the sent emails.

func WithWorkers

func WithWorkers(num uint8) OptFunc

WithWorkers sets the number of simultaneous email sender workers for the Queue.

type Queue

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

Queue represents a worker queue performing email send operations.

func New

func New(senders, receivers, subject, host, textFile string, opts ...OptFunc) (*Queue, error)

New constructs an instance of queue.Queue with the provided options.

func (*Queue) Run

func (q *Queue) Run() error

Run initates the mail queue and performs all the specified operations based off of the given queue configuration.

type Stats

type Stats struct {
	Sender  string `csv:"sender"`
	Total   uint   `csv:"total"`
	Failed  uint   `csv:"failed"`
	Bounced uint   `csv:"bounced"`
	// contains filtered or unexported fields
}

Stats represents a unique senders statistics including total emails successfully sent, emails that have failed to send as well as bounces.

Jump to

Keyboard shortcuts

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