libemail

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderTemplate added in v0.2.0

func RenderTemplate(name, in string, m map[string]string) (string, error)

func RenderTemplateFromFs added in v0.2.0

func RenderTemplateFromFs(path string, m map[string]string) (string, error)

func RenderTemplateFromReader added in v0.2.0

func RenderTemplateFromReader(name string, r io.Reader, m map[string]string) (string, error)

Types

type Base64

type Base64 SmartString

func (*Base64) UnmarshalJSON

func (val *Base64) UnmarshalJSON(b []byte) error

func (*Base64) Unpack

func (val *Base64) Unpack() (string, error)

type Email

type Email struct {
	// Which of the accounts registered via the pool module you want to schedule on
	Account     string   `json:"account" validate:"empty=false"`
	To          []string `json:"to" validate:"empty=false"`
	From        string   `json:"from" validate:"empty=false"`
	Cc          []string `json:"cc"`
	Bcc         []string `json:"bcc"`
	Subject     string   `json:"subject"`
	ReplyTo     []string `json:"reply_to"`
	Sender      string   `json:"sender"`
	Attachments []string `json:"attachments"`
	// base64 encoded
	Body *string `json:"body,omitempty"`
	// base64 encoded
	HTML *string      `json:"html,omitempty"`
	File *SmartString `json:"file,omitempty"`
	// delay in seconds from now
	Delay int `json:"delay" validate:"gte=0"`
}

type Sender

type Sender interface {
	Init(config *oauth2.Config, token *oauth2.Token) error
	Cleanup() error
	Send(message *Email) (interface{}, error)
}

type SmartString

type SmartString string

func (*SmartString) String

func (val *SmartString) String() string

default *SmartString.String() to "" to avoid panicking

type Template added in v0.2.0

type Template struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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