package main import ( "crypto/tls" "fmt" "html" "log" "mime" "net" "net/smtp" "sort" "strings" "time" ) func filterEmailAlerts(alerts []Alert, settings EmailSettings) []Alert { allowedSeverity, allowedSource := map[string]bool{}, map[string]bool{} for _, value := range settings.Severities { allowedSeverity[value] = true } for _, value := range settings.Sources { allowedSource[value] = true } var result []Alert for _, alert := range alerts { if allowedSeverity[alert.Severity] && allowedSource[alert.Source] { result = append(result, alert) } } return result } func sendAlertEmail(settings EmailSettings, alerts []Alert, test bool) error { subject := "Proxmox Dashboard: сводка уведомлений" body := `
Тестовое сообщение успешно отправлено вашим сервером.