Documentation
¶
Index ¶
- Constants
- func IsManagedSMTPSecretKey(key string) bool
- func LoadSMTPConfig(ctx context.Context, db *data.DB, fallback SMTPConfig) (SMTPConfig, SMTPConfigSource, error)
- func SaveSMTPConfig(ctx context.Context, db *data.DB, cfg SMTPConfig, ...) error
- func SendTemplateEmail(ctx context.Context, db *data.DB, sender Mailer, templateType, to string, ...) error
- type LogMailer
- func (m *LogMailer) Send(to, subject, body string) error
- func (m *LogMailer) SendPasswordResetEmail(to, token string) error
- func (m *LogMailer) SendSecurityAlert(to, alertType, details string) error
- func (m *LogMailer) SendVerificationEmail(to, token string) error
- func (m *LogMailer) SendWorkspaceInvite(to, workspaceName, inviterEmail string) error
- type Mailer
- type RuntimeMailer
- func (m *RuntimeMailer) Send(to, subject, body string) error
- func (m *RuntimeMailer) SendPasswordResetEmail(to, token string) error
- func (m *RuntimeMailer) SendSecurityAlert(to, alertType, details string) error
- func (m *RuntimeMailer) SendVerificationEmail(to, token string) error
- func (m *RuntimeMailer) SendWorkspaceInvite(to, workspaceName, inviterEmail string) error
- type SMTPConfig
- type SMTPConfigSource
- type SMTPMailer
- func (m *SMTPMailer) Send(to, subject, body string) error
- func (m *SMTPMailer) SendPasswordResetEmail(to, token string) error
- func (m *SMTPMailer) SendSecurityAlert(to, alertType, details string) error
- func (m *SMTPMailer) SendVerificationEmail(to, token string) error
- func (m *SMTPMailer) SendWorkspaceInvite(to, workspaceName, inviterEmail string) error
Constants ¶
View Source
const ( SMTPSecretHostKey = "ozy.smtp.host" SMTPSecretPortKey = "ozy.smtp.port" SMTPSecretUsernameKey = "ozy.smtp.username" SMTPSecretPasswordKey = "ozy.smtp.password" SMTPSecretFromKey = "ozy.smtp.from" )
Variables ¶
This section is empty.
Functions ¶
func IsManagedSMTPSecretKey ¶
func LoadSMTPConfig ¶
func LoadSMTPConfig(ctx context.Context, db *data.DB, fallback SMTPConfig) (SMTPConfig, SMTPConfigSource, error)
func SaveSMTPConfig ¶
Types ¶
type LogMailer ¶
type LogMailer struct{}
LogMailer is a console fallback mailer used when SMTP is not configured.
func NewLogMailer ¶
func NewLogMailer() *LogMailer
func (*LogMailer) SendPasswordResetEmail ¶
func (*LogMailer) SendSecurityAlert ¶
func (*LogMailer) SendVerificationEmail ¶
func (*LogMailer) SendWorkspaceInvite ¶
type Mailer ¶
type Mailer interface {
Send(to, subject, body string) error
SendVerificationEmail(to, token string) error
SendPasswordResetEmail(to, token string) error
SendSecurityAlert(to, alertType, details string) error
SendWorkspaceInvite(to, workspaceName, inviterEmail string) error
}
Mailer defines the interface for sending emails
func NewRuntimeMailer ¶
func NewRuntimeMailer(db *data.DB, fallback SMTPConfig) Mailer
type RuntimeMailer ¶
type RuntimeMailer struct {
// contains filtered or unexported fields
}
func (*RuntimeMailer) Send ¶
func (m *RuntimeMailer) Send(to, subject, body string) error
func (*RuntimeMailer) SendPasswordResetEmail ¶
func (m *RuntimeMailer) SendPasswordResetEmail(to, token string) error
func (*RuntimeMailer) SendSecurityAlert ¶
func (m *RuntimeMailer) SendSecurityAlert(to, alertType, details string) error
func (*RuntimeMailer) SendVerificationEmail ¶
func (m *RuntimeMailer) SendVerificationEmail(to, token string) error
func (*RuntimeMailer) SendWorkspaceInvite ¶
func (m *RuntimeMailer) SendWorkspaceInvite(to, workspaceName, inviterEmail string) error
type SMTPConfig ¶
func SMTPConfigFromEnvironment ¶
func SMTPConfigFromEnvironment() SMTPConfig
func (SMTPConfig) Configured ¶
func (c SMTPConfig) Configured() bool
func (SMTPConfig) Validate ¶
func (c SMTPConfig) Validate() error
type SMTPConfigSource ¶
type SMTPConfigSource string
const ( SMTPConfigSourceConsole SMTPConfigSource = "console" SMTPConfigSourceEnvironment SMTPConfigSource = "environment" SMTPConfigSourceDatabase SMTPConfigSource = "database" )
type SMTPMailer ¶
SMTPMailer implementation
func NewSMTPMailer ¶
func NewSMTPMailer(host, port, user, pass, from string) *SMTPMailer
func (*SMTPMailer) Send ¶
func (m *SMTPMailer) Send(to, subject, body string) error
func (*SMTPMailer) SendPasswordResetEmail ¶
func (m *SMTPMailer) SendPasswordResetEmail(to, token string) error
func (*SMTPMailer) SendSecurityAlert ¶
func (m *SMTPMailer) SendSecurityAlert(to, alertType, details string) error
func (*SMTPMailer) SendVerificationEmail ¶
func (m *SMTPMailer) SendVerificationEmail(to, token string) error
func (*SMTPMailer) SendWorkspaceInvite ¶
func (m *SMTPMailer) SendWorkspaceInvite(to, workspaceName, inviterEmail string) error
Click to show internal directories.
Click to hide internal directories.