email

package
v0.0.0-...-3975a26 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 9 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 Manager

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

Manager holds data needed to send emails to the users.

func NewManager

func NewManager(log zerolog.Logger, host, username, password, from string,
	herm hermes.Hermes, l httpflow.Links) (*Manager, error)

NewManager creates a fresh instance of email manager.

func (*Manager) SendAccountActivation

func (m *Manager) SendAccountActivation(ctx context.Context, eml, tok string)

SendAccountActivation sends an email regarding account activation with the token, embedded into a full URL, to the specified email address.

func (*Manager) SendAccountDeleted

func (m *Manager) SendAccountDeleted(ctx context.Context, eml string)

SendAccountDeleted sends an email regarding successful account deletion to the specified email address.

func (*Manager) SendAccountRecovery

func (m *Manager) SendAccountRecovery(ctx context.Context, eml, tok string)

SendAccountRecovery sends an email regarding account recovery with the token, embedded into a full URL, to the specified email address.

func (*Manager) SendEmailChanged

func (m *Manager) SendEmailChanged(ctx context.Context, oEml, nEml string)

SendEmailChanged sends an email to the old email address (first parameter) about a new email address being set (second parameter).

func (*Manager) SendEmailVerification

func (m *Manager) SendEmailVerification(ctx context.Context, eml, tok string)

SendEmailVerification sends an email regarding new email verification with the token, embedded into a full URL, to the specified email address.

func (*Manager) SendPasswordChanged

func (m *Manager) SendPasswordChanged(ctx context.Context, eml string, recov bool)

SendPasswordChanged sends an email notifying about a successful password change to the specified email address. Last parameter specifies whether the password was changed during the recovery process or not.

type Placeholder

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

Placeholder is a drop-in no-op replacement of a working email sender.

func NewPlaceholder

func NewPlaceholder(log zerolog.Logger, ll httpflow.Links) Placeholder

NewPlaceholder creates a new email service placeholder instance.

func (Placeholder) SendAccountActivation

func (p Placeholder) SendAccountActivation(_ context.Context, eml, tok string)

SendAccountActivation should send an email regarding account activation with the token, embedded into a full URL, to the specified email address.

func (Placeholder) SendAccountDeleted

func (p Placeholder) SendAccountDeleted(ctx context.Context, eml string)

SendAccountDeleted should send an email regarding successful account deletion to the specified email address.

func (Placeholder) SendAccountRecovery

func (p Placeholder) SendAccountRecovery(_ context.Context, eml, tok string)

SendAccountRecovery should send an email regarding account recovery with the token, embedded into a full URL, to the specified email address.

func (Placeholder) SendEmailChanged

func (p Placeholder) SendEmailChanged(_ context.Context, oEml, nEml string)

SendEmailChanged should send an email to the old email address (first parameter) about a new email address being set (second parameter).

func (Placeholder) SendEmailVerification

func (p Placeholder) SendEmailVerification(_ context.Context, eml, tok string)

SendEmailVerification should send an email regarding new email verification with the token, embedded into a full URL, to the specified email address.

func (Placeholder) SendPasswordChanged

func (p Placeholder) SendPasswordChanged(ctx context.Context, eml string, recov bool)

SendPasswordChanged should send an email notifying about a successful password change to the specified email address. Last parameter specifies whether the password was changed during the recovery process or not.

Jump to

Keyboard shortcuts

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