email

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 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

Overview

Package email provides outbound email delivery for the admin service.

The Sender interface lets the admin server stay decoupled from the underlying provider. SESSender talks to Amazon SES; NoopSender is used in development environments where SES is not configured.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopSender

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

NoopSender satisfies Sender without delivering anything. It logs that an invitation was created (id + email) so developers running without an email provider know one is pending; the token itself is a bearer secret and is retrieved via the invitations API, not the logs.

func NewNoopSender

func NewNoopSender(log *logger.Logger) *NoopSender

func (*NoopSender) SendInvitation

func (n *NoopSender) SendInvitation(_ context.Context, inv *user.Invitation, _ string) error

type SMTPConfig

type SMTPConfig struct {
	Host            string // smtp.gmail.com
	Port            int    // 587
	Username        string // mailer@example.com (auth identity)
	Password        string // Google app password (16 chars, no spaces)
	FromEmail       string // invites@example.com (send-as alias or auth user)
	FromName        string // optional display name shown in mail clients
	InviteAcceptURL string
	AppDisplayName  string
}

SMTPConfig holds the parameters needed to construct an SMTPSender. Designed for authenticated SMTP submission (e.g. Google Workspace via smtp.gmail.com:587 with an app password) but works with any provider that speaks STARTTLS + PLAIN auth on the submission port.

type SMTPSender

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

SMTPSender delivers email via authenticated SMTP submission.

func NewSMTPSender

func NewSMTPSender(cfg SMTPConfig, log *logger.Logger) (*SMTPSender, error)

NewSMTPSender constructs an SMTPSender. Returns an error if required configuration is missing.

func (*SMTPSender) SendInvitation

func (s *SMTPSender) SendInvitation(_ context.Context, inv *user.Invitation, inviterEmail string) error

SendInvitation sends an invitation email via SMTP submission.

type Sender

type Sender interface {
	SendInvitation(ctx context.Context, inv *user.Invitation, inviterEmail string) error
}

Sender delivers transactional emails on behalf of the admin service.

Jump to

Keyboard shortcuts

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