email

package
v0.0.0-...-28185e2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvitationData

type InvitationData struct {
	InvitedBy   string // Name/email of the admin who sent the invitation
	InviteLink  string // Full URL to accept the invitation
	CurrentYear int    // Current year for copyright notice
}

InvitationData holds data for rendering the invitation email template

type Sender

type Sender interface {
	SendInvitation(ctx context.Context, to, inviteLink, invitedBy string) error
}

Sender is the interface for sending emails. Consumers (e.g., users.Service) should depend on this interface rather than *Service directly, enabling easier testing and reduced coupling between packages.

type Service

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

Service handles email sending with multiple provider support (SMTP or Resend)

func NewService

func NewService(cfg config.EmailConfig, templatesDir string, logger zerolog.Logger) (*Service, error)

NewService creates a new email service instance templatesDir should point to the directory containing HTML email templates (e.g., "web/email/templates")

func (*Service) SendInvitation

func (s *Service) SendInvitation(ctx context.Context, to, inviteLink, invitedBy string) error

SendInvitation sends an invitation email to a new user

Jump to

Keyboard shortcuts

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