This commit is contained in:
fabio
2026-02-22 17:39:36 +01:00
parent be462b814c
commit ae48383dc8
13 changed files with 359 additions and 3 deletions

19
internal/mailer/mailer.go Normal file
View File

@@ -0,0 +1,19 @@
package mailer
import (
"context"
"trustcontact/internal/config"
)
type Mailer interface {
Send(ctx context.Context, to, subject, htmlBody, textBody string) error
}
func NewMailer(cfg *config.Config) (Mailer, error) {
if cfg.Env == config.EnvDevelop {
return NewSinkMailer(cfg.EmailSinkDir)
}
return NewSMTPMailer(cfg)
}