Documentation
¶
Overview ¶
Package email provides email notification services using Brevo.
Index ¶
- type Config
- type EmailRequest
- type EmailService
- func (s *EmailService) GetEmailStatus(ctx context.Context, emailID string) (*repository.EmailLog, error)
- func (s *EmailService) ListEmails(ctx context.Context, filter repository.EmailFilter) ([]repository.EmailLog, error)
- func (s *EmailService) SendCustomEmail(ctx context.Context, req EmailRequest) error
- func (s *EmailService) SendJobCompletionEmail(ctx context.Context, jobID string, success bool, recipients []string) error
- func (s *EmailService) SendTestResultsEmail(ctx context.Context, testRunID string, results TestResults, ...) error
- func (s *EmailService) SendWorkflowNotification(ctx context.Context, workflowID string, status string, recipients []string) error
- type Settings
- type TestResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config holds the email notification configuration.
func ConfigFromEnv ¶
func ConfigFromEnv() Config
ConfigFromEnv creates a configuration from environment variables.
type EmailRequest ¶
type EmailRequest struct {
To []brevo.EmailAddress
Cc []brevo.EmailAddress
Bcc []brevo.EmailAddress
Subject string
TemplateType templates.TemplateType
Data map[string]interface{}
Attachments []brevo.Attachment
Tags []string
}
EmailRequest represents a request to send a custom email.
type EmailService ¶
type EmailService struct {
// contains filtered or unexported fields
}
EmailService handles sending email notifications.
func NewEmailService ¶
func NewEmailService( client *brevo.Client, repo repository.EmailRepository, eventBus event.Dispatcher, ) *EmailService
NewEmailService creates a new email service.
func (*EmailService) GetEmailStatus ¶
func (s *EmailService) GetEmailStatus(ctx context.Context, emailID string) (*repository.EmailLog, error)
GetEmailStatus retrieves the status of a sent email.
func (*EmailService) ListEmails ¶
func (s *EmailService) ListEmails(ctx context.Context, filter repository.EmailFilter) ([]repository.EmailLog, error)
ListEmails lists sent emails with optional filtering.
func (*EmailService) SendCustomEmail ¶
func (s *EmailService) SendCustomEmail(ctx context.Context, req EmailRequest) error
SendCustomEmail sends an arbitrary transactional email.
func (*EmailService) SendJobCompletionEmail ¶
func (s *EmailService) SendJobCompletionEmail(ctx context.Context, jobID string, success bool, recipients []string) error
SendJobCompletionEmail sends a job completion notification.
func (*EmailService) SendTestResultsEmail ¶
func (s *EmailService) SendTestResultsEmail(ctx context.Context, testRunID string, results TestResults, recipients []string) error
SendTestResultsEmail sends test suite results.
func (*EmailService) SendWorkflowNotification ¶
func (s *EmailService) SendWorkflowNotification(ctx context.Context, workflowID string, status string, recipients []string) error
SendWorkflowNotification sends a workflow status email.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package repository provides email persistence.
|
Package repository provides email persistence. |
|
Package subscriber provides event subscribers for email notifications.
|
Package subscriber provides event subscribers for email notifications. |
|
Package templates provides email template management.
|
Package templates provides email template management. |