cluade code review changes

This commit is contained in:
2026-02-20 16:38:24 +05:30
parent a048cb0d73
commit f1601020b1
16 changed files with 150 additions and 70 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"io"
"net/mail"
"slices"
)
// Sender is the interface that wraps the Send method.

View File

@@ -1,6 +1,7 @@
package email
import (
"fmt"
"os"
"path/filepath"
@@ -19,7 +20,10 @@ func (DumpToTemp) Send(msg *Message) error {
}
dir := os.TempDir()
id, _ := uuid.NewV7()
id, err := uuid.NewV7()
if err != nil {
return fmt.Errorf("email: failed to generate UUID: %w", err)
}
file := filepath.Join(dir, id.String()+".html")
if err := os.WriteFile(file, []byte(msg.HtmlBody), 0440); err != nil {

View File

@@ -87,6 +87,6 @@ func (t SMTP) Send(msg *Message) error {
return err
}
slog.Info("sent email %s" + msg.Subject)
slog.Info("sent email", slog.String("subject", msg.Subject))
return nil
}