common

package
v0.0.0-...-ca24b28 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusFailed        = "failed"
	StatusRetry         = "retry"
	StatusDelivered     = "delivered"
	StatusQueued        = "queued"
	StatusUndeliverable = "undeliverable"
)
View Source
const HTMLWrapperTemplate = `` /* 166-byte string literal not displayed */

Variables

This section is empty.

Functions

func UAAErrorFor

func UAAErrorFor(err error) error

Types

type Delivery

type Delivery struct {
	MessageID       string
	Options         Options
	UserGUID        string
	Email           string
	Space           cf.CloudControllerSpace
	Organization    cf.CloudControllerOrganization
	ClientID        string
	UAAHost         string
	Scope           string
	VCAPRequestID   string
	RequestReceived time.Time
	CampaignID      string
}

type DeliveryFailureHandler

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

func NewDeliveryFailureHandler

func NewDeliveryFailureHandler(numRetries int) DeliveryFailureHandler

func (DeliveryFailureHandler) Handle

func (h DeliveryFailureHandler) Handle(job Retryable, logger lager.Logger)

type HTML

type HTML struct {
	BodyContent    string
	BodyAttributes string
	Head           string
	Doctype        string
}

type MessageContext

type MessageContext struct {
	From              string
	ReplyTo           string
	To                string
	Subject           string
	Text              string
	HTML              string
	HTMLComponents    HTML
	TextTemplate      string
	HTMLTemplate      string
	SubjectTemplate   string
	KindDescription   string
	SourceDescription string
	UserGUID          string
	ClientID          string
	MessageID         string
	Space             string
	SpaceGUID         string
	Organization      string
	OrganizationGUID  string
	UnsubscribeID     string
	Scope             string
	Endorsement       string
	OrganizationRole  string
	RequestReceived   time.Time
	Domain            string
}

func NewMessageContext

func NewMessageContext(delivery Delivery, sender, domain string, cloak conceal.CloakInterface, templates Templates) MessageContext

func (*MessageContext) Escape

func (context *MessageContext) Escape()

type Options

type Options struct {
	ReplyTo           string
	Subject           string
	KindDescription   string
	SourceDescription string
	Text              string
	HTML              HTML
	KindID            string
	To                string
	Role              string
	Endorsement       string
	TemplateID        string
}

type Packager

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

func NewPackager

func NewPackager(templates templatesLoader, cloak conceal.CloakInterface) Packager

func (Packager) CompileParts

func (packager Packager) CompileParts(context MessageContext) ([]mail.Part, error)

func (Packager) Pack

func (packager Packager) Pack(context MessageContext) (mail.Message, error)

func (Packager) PrepareContext

func (packager Packager) PrepareContext(delivery Delivery, sender, domain string) (MessageContext, error)

type Retryable

type Retryable interface {
	Retry(duration time.Duration)
	State() (retryCount int, activeAt time.Time)
}

type Templates

type Templates struct {
	Name    string
	Subject string
	Text    string
	HTML    string
}

type UAADownError

type UAADownError struct {
	Err error
}

func (UAADownError) Error

func (e UAADownError) Error() string

type UAAGenericError

type UAAGenericError struct {
	Err error
}

func (UAAGenericError) Error

func (e UAAGenericError) Error() string

type UAAUserNotFoundError

type UAAUserNotFoundError struct {
	Err error
}

func (UAAUserNotFoundError) Error

func (e UAAUserNotFoundError) Error() string

type UserLoader

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

func NewUserLoader

func NewUserLoader(uaaClient uaaEmailGetter) UserLoader

func (UserLoader) Load

func (loader UserLoader) Load(guids []string, token string) (map[string]uaa.User, error)

Jump to

Keyboard shortcuts

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