mailer

package
v0.0.1-alpha5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIME = "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	Recipients string
	Subject    string
	Body       string
	Sender     string
	To         []string
}

Inputs holds our inputs struct

type Message

type Message struct {
	Msg    []byte
	Sender string
	To     []string
}

Message holds our message struct

type Service

type Service struct {
	Identity string
	Username string
	Password string
	Host     string
	Address  string
}

Service holds our service struct

func NewMailer

func NewMailer(config *context.Config) *Service

NewMailer instantiates the mailer service from config file

func (*Service) NewMessage

func (s *Service) NewMessage(inputs Inputs) Message

NewMessage carefully craft a new message from inputs struct

func (*Service) Ping

func (s *Service) Ping() error

func (*Service) SendEmail

func (s *Service) SendEmail(message Message) error

SendEmail sends an email

func (*Service) SendEmailTemplate

func (s *Service) SendEmailTemplate(inputs Inputs, emailType string, data interface{}) error

SendEmailTemplate sends a templated email

Jump to

Keyboard shortcuts

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