templates

package
v4.36.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TemplateNameEmailEnvelope                 = "Envelope.tmpl"
	TemplateNameEmailIdentityVerificationHTML = "IdentityVerification.html"
	TemplateNameEmailIdentityVerificationTXT  = "IdentityVerification.txt"
	TemplateNameEmailPasswordResetHTML        = "PasswordReset.html"
	TemplateNameEmailPasswordResetTXT         = "PasswordReset.txt"
)

Template File Names.

View Source
const (
	TemplateCategoryNotifications = "notification"
)

Template Category Names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v4.36.3

type Config struct {
	EmailTemplatesPath string
}

Config for the Provider.

type EmailEnvelopeBodyValues added in v4.36.3

type EmailEnvelopeBodyValues struct {
	PlainText string
	HTML      string
}

EmailEnvelopeBodyValues are the values used for the email envelopes bodies.

type EmailEnvelopeValues added in v4.36.3

type EmailEnvelopeValues struct {
	ProcessID    int
	UUID         string
	Host         string
	ServerName   string
	SenderDomain string
	Identifier   string
	From         string
	To           string
	Subject      string
	Date         time.Time
	Boundary     string
	Body         EmailEnvelopeBodyValues
}

EmailEnvelopeValues are the values used for the email envelopes.

type EmailIdentityVerificationValues added in v4.36.3

type EmailIdentityVerificationValues struct {
	UUID        string
	Title       string
	DisplayName string
	RemoteIP    string
	LinkURL     string
	LinkText    string
}

EmailIdentityVerificationValues are the values used for the identity verification templates.

type EmailPasswordResetValues added in v4.36.3

type EmailPasswordResetValues struct {
	UUID        string
	Title       string
	DisplayName string
	RemoteIP    string
}

EmailPasswordResetValues are the values used for password reset templates.

type Format added in v4.36.3

type Format int

Format of a template.

const (
	DefaultFormat Format = iota
	HTMLFormat
	PlainTextFormat
)

Formats.

type HTMLPlainTextTemplate added in v4.36.3

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

HTMLPlainTextTemplate is the template type which contains both the html and txt versions of a template.

func (HTMLPlainTextTemplate) Get added in v4.36.3

func (f HTMLPlainTextTemplate) Get(format Format) (t *template.Template)

Get returns the appropriate template given the format.

type NotificationTemplates added in v4.36.3

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

NotificationTemplates are the templates for the notification system.

type Provider added in v4.36.3

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

Provider of templates.

func New added in v4.36.3

func New(config Config) (provider *Provider, err error)

New creates a new templates' provider.

func (Provider) ExecuteEmailEnvelope added in v4.36.3

func (p Provider) ExecuteEmailEnvelope(wr io.Writer, data EmailEnvelopeValues) (err error)

ExecuteEmailEnvelope writes the envelope template to the given io.Writer.

func (Provider) ExecuteEmailIdentityVerificationTemplate added in v4.36.3

func (p Provider) ExecuteEmailIdentityVerificationTemplate(wr io.Writer, data EmailIdentityVerificationValues, format Format) (err error)

ExecuteEmailIdentityVerificationTemplate writes the identity verification template to the given io.Writer.

func (Provider) ExecuteEmailPasswordResetTemplate added in v4.36.3

func (p Provider) ExecuteEmailPasswordResetTemplate(wr io.Writer, data EmailPasswordResetValues, format Format) (err error)

ExecuteEmailPasswordResetTemplate writes the password reset template to the given io.Writer.

type Templates added in v4.36.3

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

Templates is the struct which holds all the *template.Template values.

Jump to

Keyboard shortcuts

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