Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SMTPConfig ¶
type SMTPConfig struct {
Host string
Port int
Username string
Password string
From string
AuthType string
}
SMTPConfig holds server-level SMTP configuration from env vars / CLI flags.
func (SMTPConfig) IsConfigured ¶
func (c SMTPConfig) IsConfigured() bool
IsConfigured returns true if the minimum SMTP settings are provided.
type SMTPStatus ¶
type SMTPStatus struct {
Configured bool `json:"configured"`
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
From string `json:"from,omitempty"`
AuthType string `json:"auth_type,omitempty"`
}
SMTPStatus is the non-sensitive SMTP info returned to the admin UI.
type Service ¶
type Service interface {
// Dispatch evaluates notification config and sends email if appropriate.
Dispatch(ctx context.Context, repo *model.Repo, pipeline *model.Pipeline, previousStatus model.StatusValue) error
// TestSMTP sends a test email to the configured From address.
TestSMTP(ctx context.Context) error
// SMTPStatus returns the non-sensitive SMTP configuration for display.
SMTPStatus() SMTPStatus
}
Service handles sending pipeline notifications.
func NewService ¶
func NewService(store model.NotificationConfigStore, unsubStore model.EmailUnsubscribeStore, smtpCfg SMTPConfig, serverHost, jwtSecret string, userEmailLookup UserEmailLookup, userIDLookup UserIDLookup) Service
NewService creates a notification service.
type UserEmailLookup ¶ added in v5.7.0
UserEmailLookup resolves a forge login name to the user's configured email. Returns empty string if the user is not found.
type UserIDLookup ¶ added in v5.8.0
UserIDLookup resolves a forge login name to the user's internal ID. Returns 0 if the user is not found.
Click to show internal directories.
Click to hide internal directories.