feat: Move mail system to shared

This commit is contained in:
2026-07-28 09:50:46 +01:00
parent 03cf1715b2
commit dc0d6cb2d2
36 changed files with 1089 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package mail
import "time"
// MonitorEvent is a monitor state transition, as the control plane's
// notification dispatcher sees it. It lives here rather than in server/ so that
// the email templates and the caller agree on the fields without server's model
// package leaking into shared.
type MonitorEvent struct {
MonitorName string
Type string
OldStatus string
NewStatus string
Message string
Time time.Time
// Down drives the pill and the subject verb. The caller decides it, since
// only server/ knows which status strings mean down.
Down bool
}
// SendMonitorAlert delivers one state-change notification to an SMTP
// notification channel's recipients, which may be a comma-separated list.
func (s Sender) SendMonitorAlert(to string, ev MonitorEvent) error {
return s.sendTemplate(to, "", "monitoralert", ev)
}