email

package
v0.0.0-...-0ae65ae Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package email provides email sending functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentLoginToken

type ContentLoginToken struct {
	Email  string
	Name   string
	URL    string
	Token  string
	Expiry time.Time
}

ContentLoginToken defines content for login token email template.

type Email

type Email struct {
	Name    string
	Address string
}

Email struct holds email address and recipient name.

func NewEmail

func NewEmail(name string, address string) Email

NewEmail returns an email address.

type Mailer

type Mailer struct {
	// contains filtered or unexported fields
}

Mailer is a SMTP mailer.

func NewMailer

func NewMailer() (*Mailer, error)

NewMailer returns a configured SMTP Mailer.

func (*Mailer) LoginToken

func (m *Mailer) LoginToken(name, address string, content ContentLoginToken) error

LoginToken creates and sends a login token email with provided template content.

func (*Mailer) Send

func (m *Mailer) Send(email *message) error

Send sends the mail via smtp.

type MockMailer

type MockMailer struct {
	LoginTokenFn      func(name, email string, c ContentLoginToken) error
	LoginTokenInvoked bool
}

MockMailer is a mock Mailer

func (*MockMailer) LoginToken

func (s *MockMailer) LoginToken(n, e string, c ContentLoginToken) error

LoginToken is a mock for LoginToken

Jump to

Keyboard shortcuts

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