email

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package email provides email notification services using Brevo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Brevo    brevo.Config
	Settings Settings
}

Config holds the email notification configuration.

func ConfigFromEnv

func ConfigFromEnv() Config

ConfigFromEnv creates a configuration from environment variables.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a default configuration.

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.

type Settings

type Settings struct {
	EnableAutoNotifications bool
	BatchSize               int
	RetryAttempts           int
	RetryDelaySeconds       int
}

Settings holds email service settings.

type TestResults

type TestResults struct {
	PassedCount  int
	FailedCount  int
	SkippedCount int
	Duration     time.Duration
}

TestResults holds test execution results for email notifications.

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.

Jump to

Keyboard shortcuts

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