mail

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Production = false

Production should be set to true in production environment.

Functions

func RenderTemplate added in v1.0.1

func RenderTemplate(email *Email, context Context) (string, error)

RenderTemplate renders the email into its template with context.

func Send

func Send(email *Email, context Context) error

Send the email using our default adapter and optional context.

Types

type Context added in v1.0.1

type Context map[string]interface{}

Context defines a simple list of string:value pairs for mail templates.

type Email added in v1.0.1

type Email struct {
	Recipients []string
	ReplyTo    string
	Subject    string
	Body       string
	Template   string
	Layout     string
}

Email represents an email to be sent.

func New added in v1.0.1

func New(r string) *Email

New returns a new email with the default tenplates and the given recipient.

func (*Email) Invalid added in v1.0.1

func (e *Email) Invalid() bool

Invalid returns true if this email is not ready to send.

func (*Email) String added in v1.0.1

func (e *Email) String() string

String returns a formatted string representation for debug.

type Sender added in v1.0.1

type Sender interface {
	Send(email *Email) error
}

Sender is the interface for our adapters for mail services.

var Service Sender

Service is the mail adapter to send with and should be set on startup.

Directories

Path Synopsis
adapters

Jump to

Keyboard shortcuts

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