Documentation
¶
Index ¶
- type EmailService
- type SMTPConfig
- type Service
- func (s *Service) IsEnabled() bool
- func (s *Service) SendAccountCreatedEmail(ctx context.Context, to, username, plainPassword string) error
- func (s *Service) SendAccountDeletedNotification(ctx context.Context, to, username string) error
- func (s *Service) SendAccountLockoutEmail(ctx context.Context, to, username string) error
- func (s *Service) SendDataExportNotificationEmail(ctx context.Context, to, username string) error
- func (s *Service) SendEmailUpdateVerificationEmail(ctx context.Context, to, username, token string) error
- func (s *Service) SendPasswordResetEmail(ctx context.Context, to, username, token string) error
- func (s *Service) SendUserApprovedEmail(ctx context.Context, to, username string) error
- func (s *Service) SendUserRejectedEmail(ctx context.Context, to, username string) error
- func (s *Service) SendUserSoftDeletedEmail(ctx context.Context, to, username, reason string) error
- func (s *Service) SendUserSuspendedEmail(ctx context.Context, to, username, reason string) error
- func (s *Service) SendUserUnsuspendedEmail(ctx context.Context, to, username string) error
- func (s *Service) SendVerificationEmail(ctx context.Context, to, username, token string) error
- func (s *Service) SetBaseURL(baseURL string)
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 ¶
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) 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 ¶
SendAccountDeletedNotification sends an account deletion notification email to a user
func (*Service) SendAccountLockoutEmail ¶
SendAccountLockoutEmail sends an account lockout notification email to a user
func (*Service) SendDataExportNotificationEmail ¶
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 ¶
SendPasswordResetEmail sends a password reset email to a user
func (*Service) SendUserApprovedEmail ¶
SendUserApprovedEmail sends an email when a user's registration is approved
func (*Service) SendUserRejectedEmail ¶
SendUserRejectedEmail sends an email when a user's registration is rejected
func (*Service) SendUserSoftDeletedEmail ¶
SendUserSoftDeletedEmail sends an email when a user's account is soft deleted
func (*Service) SendUserSuspendedEmail ¶
SendUserSuspendedEmail sends an email when a user's account is suspended
func (*Service) SendUserUnsuspendedEmail ¶
SendUserUnsuspendedEmail sends an email when a user's account is unsuspended
func (*Service) SendVerificationEmail ¶
SendVerificationEmail sends a verification email to a user
func (*Service) SetBaseURL ¶
SetBaseURL sets the base URL for verification links