events

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MailDir defines the directory where mail text and HTML
	// templates are stored.
	MailDir = "mail"
	// MailHTMLExtension defines the extension for executing
	// HTML templates.
	MailHTMLExtension = ".cms"
	// MailTextExtension defines the extension for executing
	// text templates.
	MailTextExtension = ".txt"
	// SubjectPrefix defines prefix attached to all emails
	// from Verbis.
	SubjectPrefix = "Verbis - "
	// MasterTplLayout defines the master layout for executing
	// HTML templates.
	MasterTplLayout = "layout"
)

Variables

View Source
var (
	// ErrWrongType is returned by an event when the wrong
	// type is passed to Dispatch
	ErrWrongType = errors.New("wrong type passed to dispatch")
)

Functions

func HealthCheck

func HealthCheck(env *environment.Env) error

HealthCheck performs a check on the environment and mail client to see if mail can be sent with the current configuration. Returns errors.INVALID if the environment is nil, the mail driver does not exist or if there was an error creating a new client.

Types

type ChangedPassword

type ChangedPassword struct {
	Password string
	User     domain.UserPart
	// contains filtered or unexported fields
}

ChangedPassword defines the event instance for config resetting passwords, Password and User are required for dispatch.

func NewChangedPassword

func NewChangedPassword(d *deps.Deps) *ChangedPassword

Creates a new ChangedPassword.

func (*ChangedPassword) Dispatch

func (r *ChangedPassword) Dispatch(data interface{}, recipients []string, attachments client.Attachments) error

Dispatches the ResetPassword event.

type Dispatcher

type Dispatcher interface {
	Dispatch(data interface{}, recipients []string, a client.Attachments) error
}

Dispatcher describes the event for sending email. Data and recipients are required, but attachments are optional.

type FormSend

type FormSend struct {
	Form   *domain.Form
	Values domain.FormValues
	// contains filtered or unexported fields
}

FormSend defines the event instance for config sending form data, Form and FormValues are required for dispatch.

func NewFormSend

func NewFormSend(d *deps.Deps) *FormSend

FormSend

Creates a new FormSend.

func (*FormSend) Dispatch

func (r *FormSend) Dispatch(data interface{}, recipients []string, attachments client.Attachments) error

Dispatches the FormSend event.

type ResetPassword

type ResetPassword struct {
	User domain.UserPart
	URL  string
	// contains filtered or unexported fields
}

ResetPassword defines the event instance for config resetting passwords, Token and User are required for dispatch.

func NewResetPassword

func NewResetPassword(d *deps.Deps) *ResetPassword

Creates a new ResetPassword.

func (*ResetPassword) Dispatch

func (r *ResetPassword) Dispatch(data interface{}, recipients []string, attachments client.Attachments) error

Dispatches the ResetPassword event.

Jump to

Keyboard shortcuts

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