transactional

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("notification type not supported")

Functions

This section is empty.

Types

type EmailSender

type EmailSender interface {
	SendWelcome(context.Context, *users.User) error
	SendNotification(context.Context, *users.User, *notification.Notification) error
	SendConfirmEmail(context.Context, *users.User) error
	SendMagicLink(context.Context, *users.User, string) error
}

type Sender

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

func New

func New(
	logger *zap.Logger,
	sender emails.Sender,

	userRepo db_users.Repository,
	codebaseUserRepo db_codebase.CodebaseUserRepository,
	commentsRepo db_comments.Repository,
	changeRepo db_change.Repository,
	codebaseRepo db_codebase.CodebaseRepository,
	workspaceRepo db_workspace.Repository,
	suggestionRepo db_suggestion.Repository,
	reviewRepo db_review.ReviewRepository,
	notificationSettingsRepository db_newsletter.NotificationSettingsRepository,

	jwtService *service_jwt.Service,

	notificationPreferences *service_notification.Preferences,

	analyticsClient analytics.Client,
) *Sender

func (*Sender) Send

func (e *Sender) Send(
	ctx context.Context,
	u *users.User,
	subject string,
	template templates.Template,
	data interface{},
) error

func (*Sender) SendConfirmEmail

func (e *Sender) SendConfirmEmail(ctx context.Context, usr *users.User) error
func (e *Sender) SendMagicLink(ctx context.Context, user *users.User, code string) error

func (*Sender) SendNotification

func (e *Sender) SendNotification(ctx context.Context, usr *users.User, notif *notification.Notification) error

func (*Sender) SendWelcome

func (e *Sender) SendWelcome(ctx context.Context, u *users.User) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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