notifications

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailTemplate

type EmailTemplate interface {
	EmailSubject() string
	Template
}

type InviteEmail

type InviteEmail struct {
	Subject             string
	AcceptInvitationURL string
	Inviter             client.Identity
	Tenant              authn.Tenant
}

func NewInviteEmail

func NewInviteEmail(url string, inviter client.Identity, tenant authn.Tenant) InviteEmail

func (*InviteEmail) EmailSubject

func (i *InviteEmail) EmailSubject() string

func (*InviteEmail) TemplateName

func (i *InviteEmail) TemplateName() string

type MockConfig

type MockConfig struct {
	From string
}

type NotificationsConfig

type NotificationsConfig struct {
	SMTP *SMTPConfig
	Mock *MockConfig
}

type NotificationsService

type NotificationsService interface {
	SendEmail(to string, email EmailTemplate) error
}

func NewMockNotificationsService

func NewMockNotificationsService(config MockConfig) NotificationsService

func NewNotificationsService

func NewNotificationsService(logger log.Logger, config NotificationsConfig, templates TemplateRepository) (NotificationsService, error)

func NewSmtpNotificationsService

func NewSmtpNotificationsService(logger log.Logger, config SMTPConfig, templates TemplateRepository) NotificationsService

type SMTPConfig

type SMTPConfig struct {
	Host        string
	Port        int
	User        string
	Pass        string
	From        string
	SSL         bool
	InsecureSSL bool
}

type Template

type Template interface {
	TemplateName() string
}

type TemplateRepository

type TemplateRepository interface {
	Text(values Template) (string, error)
	HTML(values Template) (string, error)
}

func NewTemplateRepository

func NewTemplateRepository(logger log.Logger) (TemplateRepository, error)

Jump to

Keyboard shortcuts

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