email

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package email implements a service for sending emails.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyUsername is returned when the username is empty.
	ErrEmptyUsername = errors.New("username cannot be empty")
	// ErrEmptyPassword is returned when the password is empty.
	ErrEmptyPassword = errors.New("password cannot be empty")
	// ErrEmptyHost is returned when the host is empty.
	ErrEmptyHost = errors.New("host cannot be empty")
	// ErrEmptyPort is returned when the port is empty.
	ErrEmptyPort = errors.New("port cannot be empty")
	// ErrEmptyLogger is returned when the logger is nil.
	ErrEmptyLogger = errors.New("logger cannot be nil")
)

Functions

This section is empty.

Types

type Sender

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

Sender is a struct that contains all the configuration of the email sender.

func New

func New(username, password, host, port string, logger *log.Logger) (*Sender, error)

New creates a new Sender.

func (*Sender) SendChangedPasswordEmail

func (s *Sender) SendChangedPasswordEmail(to string) (err error)

SendChangedPasswordEmail sends an email notifying the user that their password has been changed.

func (*Sender) SendSignUpEmail

func (s *Sender) SendSignUpEmail(to, username, password string) (err error)

SendSignUpEmail sends an email with a temporary password to the user.

Jump to

Keyboard shortcuts

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