notify

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package notify holds all different types of ways to notify users about various events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Recipient, Subject, HTMLBody, TextBody, Sender string
	Config                                         EmailConfig
}

Email holds all email data

func (*Email) Prepare

func (e *Email) Prepare(booking managerv1.Booking) Notifier

Prepare prepares the email notification, by using the passed booking, to set the Email fields

func (*Email) Send

func (e *Email) Send() error

Send sends the email notification

type EmailConfig

type EmailConfig struct {
	Host     string
	Port     string
	Username string
	Password string
}

EmailConfig holds all email configuration data

type Notifier

type Notifier interface {
	Prepare(booking managerv1.Booking) Notifier
	Send() error
}

Notifier is an interface that each type of notifier must implement.

func NewNotifier

func NewNotifier(notification managerv1.Notification) (Notifier, error)

NewNotifier returns a new Notifier based on the type of notification.

Jump to

Keyboard shortcuts

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