email

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MSOButtonStop is the HTML to stop MSO button spacing.
	MSOButtonStop = `<!--[if mso]>
                          <i style="letter-spacing: 24px">&#8202;</i>
                        <![endif]-->`
	// MSOButtonStart is the HTML to start MSO button spacing.
	MSOButtonStart = `` /* 138-byte string literal not displayed */

	// MSOHead is the HTML to start MSO head.
	MSOHead = `` /* 366-byte string literal not displayed */

)

Variables

View Source
var ErrProvider = errors.New("error with email provider")

ErrProvider is returned when there is an error with the email provider.

View Source
var HTMLTemplate string

HTMLTemplate is the HTML template for the email.

View Source
var TextTemplate string

TextTemplate is the text template for the email.

Functions

This section is empty.

Types

type Email

type Email struct {
	Subject      string
	TemplateData TemplateData
	To           *mail.Address
}

Email is the model for an email.

type MultiProviderOptions

type MultiProviderOptions struct {
	Logger *slog.Logger
}

MultiProviderOptions are the options for the multi-provider.

type Provider

type Provider interface {
	Send(ctx context.Context, e Email) error
}

Provider is the interface for an email provider.

func NewMultiProvider

func NewMultiProvider(providers []Provider, options MultiProviderOptions) (Provider, error)

NewMultiProvider creates a new multiple email provider.

type TemplateData

type TemplateData struct {
	ButtonText   string
	Expiration   string
	Greeting     string
	MagicLink    string
	Meta         TemplateMetadata
	Subtitle     string
	Title        string
	LogoImageURL string
	LogoClickURL string
	LogoAltText  string
	ReCATPTCHA   bool
}

TemplateData is the data for the email templates.

type TemplateMetadata

type TemplateMetadata struct {
	HTMLInstruction string
	HTMLTitle       string
	MSOButtonStop   template.HTML
	MSOButtonStart  template.HTML
	MSOHead         template.HTML
}

TemplateMetadata contains non-configurable metadata for the email templates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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