email

package
v0.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigTLS

func ConfigTLS(tlsCfg config.TLSConfig, serverName string) (*tls.Config, error)

ConfigTLS returns a *tls.Config configured with the provided TLSConfig and serverName. The certificate passed is added to the RootCA pool. Returns nil if no TLS configuration is needed.

Types

type Service

type Service interface {
	EmailVerification(ctx context.Context, user *model.User, verificationLink string) error
	PasswordReset(ctx context.Context, user *model.User, resetLink string) error
	SessionMFA(ctx context.Context, user *model.User, code string) error
	MemberInvitation(ctx context.Context, invitation model.MemberInvitationEmail, acceptanceLink string) error
	Notification(ctx context.Context, recipient model.NotificationEmailRecipient, notification model.NotificationEmail) error
	Message(ctx context.Context, user *model.User, subject, body string) error
}

func NewService

func NewService(smtpCfg config.SMTP, bundle *i18n.Bundle) (Service, error)

func NewServiceWithLogging

func NewServiceWithLogging(base Service, logger *slog.Logger) Service

NewServiceWithLogging wraps base with method completion logging.

type ServiceWithLogging

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

ServiceWithLogging implements Service with method completion logging.

func (ServiceWithLogging) EmailVerification

func (_d ServiceWithLogging) EmailVerification(ctx context.Context, user *model.User, verificationLink string) (err error)

EmailVerification implements Service.

func (ServiceWithLogging) MemberInvitation

func (_d ServiceWithLogging) MemberInvitation(ctx context.Context, invitation model.MemberInvitationEmail, acceptanceLink string) (err error)

MemberInvitation implements Service.

func (ServiceWithLogging) Message

func (_d ServiceWithLogging) Message(ctx context.Context, user *model.User, subject string, body string) (err error)

Message implements Service.

func (ServiceWithLogging) Notification

func (_d ServiceWithLogging) Notification(ctx context.Context, recipient model.NotificationEmailRecipient, notification model.NotificationEmail) (err error)

Notification implements Service.

func (ServiceWithLogging) PasswordReset

func (_d ServiceWithLogging) PasswordReset(ctx context.Context, user *model.User, resetLink string) (err error)

PasswordReset implements Service.

func (ServiceWithLogging) SessionMFA

func (_d ServiceWithLogging) SessionMFA(ctx context.Context, user *model.User, code string) (err error)

SessionMFA implements Service.

Jump to

Keyboard shortcuts

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