email

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailService

type EmailService interface {
	SendVerificationEmail(ctx context.Context, to, username, token string) error
	SendAccountLockoutEmail(ctx context.Context, to, username string) error
	SendUserApprovedEmail(ctx context.Context, to, username string) error
	SendUserRejectedEmail(ctx context.Context, to, username string) error
	SendUserSuspendedEmail(ctx context.Context, to, username, reason string) error
	SendUserUnsuspendedEmail(ctx context.Context, to, username string) error
	SendUserSoftDeletedEmail(ctx context.Context, to, username, reason string) error
	SendEmailUpdateVerificationEmail(ctx context.Context, to, username, token string) error
	SendDataExportNotificationEmail(ctx context.Context, to, username string) error
	SendAccountDeletedNotification(ctx context.Context, to, username string) error
	SendAccountCreatedEmail(ctx context.Context, to, username, plainPassword string) error
	SendPasswordResetEmail(ctx context.Context, to, username, token string) error
}

EmailService defines the interface for email operations

type SMTPConfig

type SMTPConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	From     string
}

SMTPConfig contains SMTP configuration

type Service

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

Service handles email sending operations

func NewService

func NewService(config SMTPConfig, logger *slog.Logger, baseURL string) *Service

NewService creates a new email service

func (*Service) IsEnabled

func (s *Service) IsEnabled() bool

IsEnabled returns whether the email service is enabled

func (*Service) SendAccountCreatedEmail

func (s *Service) SendAccountCreatedEmail(ctx context.Context, to, username, plainPassword string) error

SendAccountCreatedEmail sends a welcome email to a newly admin-created user with credentials

func (*Service) SendAccountDeletedNotification

func (s *Service) SendAccountDeletedNotification(ctx context.Context, to, username string) error

SendAccountDeletedNotification sends an account deletion notification email to a user

func (*Service) SendAccountLockoutEmail

func (s *Service) SendAccountLockoutEmail(ctx context.Context, to, username string) error

SendAccountLockoutEmail sends an account lockout notification email to a user

func (*Service) SendDataExportNotificationEmail

func (s *Service) SendDataExportNotificationEmail(ctx context.Context, to, username string) error

SendDataExportNotificationEmail sends a data export notification email to a user

func (*Service) SendEmailUpdateVerificationEmail

func (s *Service) SendEmailUpdateVerificationEmail(ctx context.Context, to, username, token string) error

SendEmailUpdateVerificationEmail sends an email update verification email to a user

func (*Service) SendPasswordResetEmail

func (s *Service) SendPasswordResetEmail(ctx context.Context, to, username, token string) error

SendPasswordResetEmail sends a password reset email to a user

func (*Service) SendUserApprovedEmail

func (s *Service) SendUserApprovedEmail(ctx context.Context, to, username string) error

SendUserApprovedEmail sends an email when a user's registration is approved

func (*Service) SendUserRejectedEmail

func (s *Service) SendUserRejectedEmail(ctx context.Context, to, username string) error

SendUserRejectedEmail sends an email when a user's registration is rejected

func (*Service) SendUserSoftDeletedEmail

func (s *Service) SendUserSoftDeletedEmail(ctx context.Context, to, username, reason string) error

SendUserSoftDeletedEmail sends an email when a user's account is soft deleted

func (*Service) SendUserSuspendedEmail

func (s *Service) SendUserSuspendedEmail(ctx context.Context, to, username, reason string) error

SendUserSuspendedEmail sends an email when a user's account is suspended

func (*Service) SendUserUnsuspendedEmail

func (s *Service) SendUserUnsuspendedEmail(ctx context.Context, to, username string) error

SendUserUnsuspendedEmail sends an email when a user's account is unsuspended

func (*Service) SendVerificationEmail

func (s *Service) SendVerificationEmail(ctx context.Context, to, username, token string) error

SendVerificationEmail sends a verification email to a user

func (*Service) SetBaseURL

func (s *Service) SetBaseURL(baseURL string)

SetBaseURL sets the base URL for verification links

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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