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.