email

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoReply = env.MustGet("EMAIL_NOREPLY")

NoReply is the default 'from' address

Functions

func CanSendTo added in v0.10.0

func CanSendTo(address string) bool

CanSendTo returns true if Fider is allowed to send email to given address

func SetWhitelist added in v0.10.0

func SetWhitelist(s string)

SetWhitelist can be used to change email whitelist during rutime

Types

type Message added in v0.10.0

type Message struct {
	Subject string
	Body    string
}

Message represents what is sent by email

func RenderMessage added in v0.10.0

func RenderMessage(templateName string, params Params) *Message

RenderMessage returns the HTML of an email based on template and params

type NoopSender

type NoopSender struct {
}

NoopSender does not send emails

func NewNoopSender added in v0.7.0

func NewNoopSender() *NoopSender

NewNoopSender creates a new NoopSender

func (*NoopSender) BatchSend added in v0.10.0

func (s *NoopSender) BatchSend(tenant *models.Tenant, templateName string, params Params, from string, to []Recipient) error

BatchSend an email to multiple recipients

func (*NoopSender) Send

func (s *NoopSender) Send(tenant *models.Tenant, templateName string, params Params, from string, to Recipient) error

Send an email

type Params added in v0.10.0

type Params map[string]interface{}

Params used to replace variables on emails

func (Params) Merge added in v0.10.0

func (p Params) Merge(p2 Params) Params

Merge given params into current params

type Recipient added in v0.10.0

type Recipient struct {
	Name    string
	Address string
	Params  Params
}

Recipient contains details of who is receiving the email

func NewRecipient added in v0.10.0

func NewRecipient(name, address string, params Params) Recipient

NewRecipient creates a new Recipient

type Sender

type Sender interface {
	Send(tenant *models.Tenant, templateName string, params Params, from string, to Recipient) error
	BatchSend(tenant *models.Tenant, templateName string, params Params, from string, to []Recipient) error
}

Sender is used to send emails

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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