emailtemplate

package
v0.0.0-...-6531ba9 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidAddressError

type InvalidAddressError struct {
	Err     error
	Address string
	Field   string
}

InvalidAddressError is an error that occurs when an address is invalid.

func (*InvalidAddressError) Error

func (e *InvalidAddressError) Error() string

Error returns the error message.

func (*InvalidAddressError) GRPCStatus

func (e *InvalidAddressError) GRPCStatus() *status.Status

GRPCStatus returns the gRPC status.

type InvalidTemplateError

type InvalidTemplateError struct {
	Err   error
	Field string
}

InvalidTemplateError is an error that occurs when a template is invalid.

func (*InvalidTemplateError) Error

func (e *InvalidTemplateError) Error() string

Error returns the error message.

func (*InvalidTemplateError) GRPCStatus

func (e *InvalidTemplateError) GRPCStatus() *status.Status

GRPCStatus returns the gRPC status.

func (*InvalidTemplateError) Unwrap

func (e *InvalidTemplateError) Unwrap() error

type Manager

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

Manager is the interface that manages email templates.

func NewManager

NewManager creates a new Manager.

func (*Manager) Get

func (m *Manager) Get(uid string) (*TemplateParser, bool)

Get returns the template parser with the given UID.

func (*Manager) OnEventCurrentMailingProviderReplaced

func (m *Manager) OnEventCurrentMailingProviderReplaced() error

OnEventCurrentMailingProviderReplaced is called when the current mailing provider is replaced.

func (*Manager) ReplaceOrInsert

func (m *Manager) ReplaceOrInsert(t *TemplateDefinition) (bool, error)

ReplaceOrInsert replaces or inserts a template definition and creates a new version of it.

func (*Manager) Verify

func (m *Manager) Verify(t *TemplateDefinition) error

Verify verifies the given template definition.

type MissingParameterError

type MissingParameterError struct {
	Parameter string
}

MissingParameterError is an error that occurs when a parameter is missing.

func (*MissingParameterError) Error

func (e *MissingParameterError) Error() string

type Parameter

type Parameter struct {
	Name         string
	DefaultValue string
}

Parameter is a parameter of an email template.

type TemplateDefinition

type TemplateDefinition struct {
	UID         string
	Name        string
	FromAddress string
	Subject     string
	Body        string
	Parameters  []Parameter
}

TemplateDefinition is an email template definition.

type TemplateParser

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

TemplateParser is an email template.

func (*TemplateParser) Parse

Parse parses the email template and returns an email message.

func (*TemplateParser) ProviderUpdated

func (t *TemplateParser) ProviderUpdated(p mailprovider.Provider) error

ProviderUpdated updates the email template with the given provider.

Jump to

Keyboard shortcuts

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