email

package
v0.0.0-...-39e015a Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CTAContent

type CTAContent struct {
	*PublicOptions

	Message          Message
	SecondaryMessage Message
	Title            string
	HelpLinks        []HelpLink

	CTAIntro string
	CTAText  string
	CTAURL   *sharedTypes.URL

	*gmailGoToAction.GmailGoToAction
}

func (*CTAContent) PlainText

func (c *CTAContent) PlainText() string

func (*CTAContent) Template

func (c *CTAContent) Template() *template.Template

func (*CTAContent) Validate

func (c *CTAContent) Validate() error

type Content

type Content interface {
	Validate() error
	Template() *template.Template
	PlainText() string
}

type Email

type Email struct {
	Content Content
	ReplyTo Identity
	Subject string
	To      Identity
	// contains filtered or unexported fields
}

func (*Email) Send

func (e *Email) Send(ctx context.Context, o *SendOptions) error

func (*Email) Validate

func (e *Email) Validate() error
type HelpLink struct {
	Before string
	URL    *sharedTypes.URL
	Label  string
	After  string
}

type Identity

type Identity struct {
	Address     sharedTypes.Email `json:"address"`
	DisplayName string            `json:"display_name"`
}

func (*Identity) String

func (i *Identity) String() string

func (*Identity) Validate

func (i *Identity) Validate() error

type Message

type Message []string

func (Message) String

func (m Message) String() string

type NoCTAContent

type NoCTAContent struct {
	*PublicOptions

	Message   Message
	Title     string
	HelpLinks []HelpLink
}

func (*NoCTAContent) PlainText

func (c *NoCTAContent) PlainText() string

func (*NoCTAContent) Template

func (c *NoCTAContent) Template() *template.Template

func (*NoCTAContent) Validate

func (c *NoCTAContent) Validate() error

type ParsedEmail

type ParsedEmail struct {
	mail.Header
	Parts map[string]string
}

type PublicOptions

type PublicOptions struct {
	AppName          string
	CustomFooter     string
	CustomFooterHTML template.HTML
	SiteURL          string
}

type SMTPAddress

type SMTPAddress string

func (SMTPAddress) Host

func (a SMTPAddress) Host() string

func (SMTPAddress) IsSpecial

func (a SMTPAddress) IsSpecial() bool

func (SMTPAddress) Validate

func (a SMTPAddress) Validate() error

type SendOptions

type SendOptions struct {
	From            Identity
	FallbackReplyTo Identity
	Sender          Sender
}

type Sender

type Sender interface {
	Send(ctx context.Context, from, to Identity, blob []byte) error
}

func NewSender

func NewSender(address SMTPAddress, smtpHello string, smtpAuth smtp.Auth) Sender

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

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