taskclient

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package taskclient provides an implementation of mailer.Client that uses the apitask package to send mail in the background.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(globalConfig *conf.GlobalConfiguration, mc mailer.Client) mailer.Client

New will return a Client that runs a task in the background that will later call the given Client. If the mailer config EmailBackgroundSending is disabled it will return the same Client passed in mc.

Types

type Task

type Task struct {
	To      string              `json:"to"`
	Subject string              `json:"subject"`
	Body    string              `json:"body"`
	Headers map[string][]string `json:"headers"`
	Typ     string              `json:"typ"`
	// contains filtered or unexported fields
}

Task holds a mail pending delivery by the Handler.

func (*Task) Run

func (o *Task) Run(ctx context.Context) error

Run implements the Run method of the apitask.Task interface by attempting to send the mail using the underying mail client.

func (*Task) Type

func (o *Task) Type() string

Run implements the Type method of the apitask.Task interface by returning the "mailer." prefix followed by the mail type.

Jump to

Keyboard shortcuts

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